2020-01-17 22:56:45 +00:00
|
|
|
- name: Install Haproxy
|
2020-05-09 20:08:14 +01:00
|
|
|
package:
|
2020-01-17 22:56:45 +00:00
|
|
|
name: haproxy
|
|
|
|
become: true
|
2019-12-08 20:16:42 +00:00
|
|
|
|
2020-01-17 22:56:45 +00:00
|
|
|
- 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
|
2019-12-08 20:16:42 +00:00
|
|
|
|
2020-04-28 20:48:15 +01:00
|
|
|
- name: Enable Haproxy
|
|
|
|
service:
|
|
|
|
name: haproxy
|
|
|
|
enabled: true
|
|
|
|
become: true
|
|
|
|
|
2020-01-17 22:56:45 +00:00
|
|
|
- name: Restart Haproxy
|
|
|
|
service:
|
|
|
|
name: haproxy
|
|
|
|
state: restarted
|
|
|
|
become: true
|
|
|
|
when: haproxy_config.changed
|