29 lines
550 B
YAML
29 lines
550 B
YAML
---
|
|
- name: Install HAProxy
|
|
ansible.builtin.dnf:
|
|
name: haproxy
|
|
state: present
|
|
|
|
- name: Enable and start HAProxy
|
|
ansible.builtin.service:
|
|
name: haproxy
|
|
state: started
|
|
enabled: true
|
|
|
|
- name: Deploy HAProxy configuration
|
|
ansible.builtin.template:
|
|
src: haproxy.cfg.j2
|
|
dest: /etc/haproxy/haproxy.cfg
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
notify: Restart haproxy
|
|
|
|
- name: Allow port 80 through firewalld
|
|
ansible.posix.firewalld:
|
|
service: http
|
|
permanent: true
|
|
immediate: true
|
|
state: enabled
|
|
|