ansible-role-haproxy/tasks/main.yml

42 lines
1.2 KiB
YAML

---
- import_tasks: haproxy-sysctl.yml
- import_tasks: haproxy-service.yml
when: not haproxy_docker_container
- import_tasks: haproxy-dataplaneapi.yml
when:
- not haproxy_docker_container
- haproxy_install_dataplane_api
- import_tasks: haproxy-letsencrypt-acme-sh.yml
when:
- haproxy_letsencrypt_managed
- letsencrypt_acme_install
- import_tasks: haproxy-ssl.yml
when: haproxy_letsencrypt_managed
- import_tasks: haproxy-nagios.yml
when:
- nagios_enabled is defined and nagios_enabled
- not haproxy_docker_container
- import_tasks: haproxy-docker-service.yml
when: haproxy_docker_container
- block:
- name: Ensure that haproxy is enabled and started
service: name=haproxy state=restarted enabled=yes
when: haproxy_enabled
ignore_errors: True
- name: Haproxy puts a new rsyslog directive. Restart rsyslog to activate it. Reload is not sufficient
service: name=rsyslog state=restarted
when:
- haproxy_enabled
- install_haproxy is changed
- name: Ensure that haproxy is stopped and disabled if needed
service: name=haproxy state=stopped enabled=no
when: not haproxy_enabled
tags: [ 'haproxy', 'haproxy_service' ]
when: not haproxy_docker_container