ansible-roles/haproxy/tasks/main.yml

26 lines
643 B
YAML

---
- name: ssl-cert package is installed
apt:
name: ssl-cert
state: installed
- name: Install HAProxy package
apt:
name: haproxy
default_release: "{{ haproxy_package_release or general_package_release | mandatory }}"
update_cache: True
state: present
- name: Copy HAProxy configuration
template:
src: "{{ item }}"
dest: /etc/haproxy/haproxy.cfg
force: yes
with_first_found:
- "templates/haproxy/haproxy.{{ inventory_hostname }}.cfg.j2"
- "templates/haproxy/haproxy.{{ host_group }}.cfg.j2"
- "templates/haproxy/haproxy.default.cfg.j2"
- "haproxy.default.cfg.j2"
notify: reload haproxy