ansible-role-haproxy/tasks/main.yml
2019-11-08 22:29:11 +01:00

37 lines
709 B
YAML

---
- name: install Haproxy
package:
name: haproxy
retries: 2
register: result
until: result is succeeded
tags: haproxy
- name: copy ssl certificates
copy:
content: '{{ item.value }}'
dest: /etc/haproxy/{{ item.key }}.pem
owner: root
group: root
mode: 0600
loop: '{{ haproxy_ssl_certificates|dict2items }}'
no_log: true
tags: haproxy
- name: copy config file
template:
src: haproxy.cfg.j2
dest: /etc/haproxy/haproxy.cfg
owner: root
group: root
mode: 0640
validate: haproxy -c -f %s
notify: reload haproxy
tags: haproxy
- name: enable ans start service
service:
name: haproxy
enabled: true
state: started
tags: haproxy