infrastructure/ansible/roles/gateway/tasks/haproxy.yml
2020-03-17 21:11:02 +00:00

20 lines
382 B
YAML

- name: Install Haproxy
apt:
name: haproxy
become: true
- name: Haproxy config
template:
src: files/haproxy.cfg
dest: /etc/haproxy/haproxy.cfg
validate: /usr/sbin/haproxy -c -- %s
backup: yes
become: true
register: haproxy_config
- name: Restart Haproxy
service:
name: haproxy
state: restarted
become: true
when: haproxy_config.changed