main.yml 542 B

123456789101112131415161718192021222324
  1. ---
  2. - name: Install haproxy
  3. action: "{{ ansible_pkg_mgr }} name=haproxy state=present"
  4. when: not openshift.common.is_containerized | bool
  5. - name: Configure haproxy
  6. template:
  7. src: haproxy.cfg.j2
  8. dest: /etc/haproxy/haproxy.cfg
  9. owner: root
  10. group: root
  11. mode: 0644
  12. notify: restart haproxy
  13. - name: Enable and start haproxy
  14. service:
  15. name: haproxy
  16. state: started
  17. enabled: yes
  18. register: start_result
  19. - name: Pause 30 seconds if haproxy was just started
  20. pause: seconds=30
  21. when: start_result | changed