37 lines
698 B
YAML
37 lines
698 B
YAML
- name: Enable epel
|
|
yum:
|
|
name: epel-release
|
|
|
|
- name: Install haproxy
|
|
yum:
|
|
name: haproxy
|
|
|
|
- name: python selinux package
|
|
yum:
|
|
name: python3-libselinux, policycoreutils-python-utils
|
|
|
|
- name: Allow haproxy to connect to any port
|
|
seboolean:
|
|
name: haproxy_connect_any
|
|
persistent: yes
|
|
state: yes
|
|
|
|
- name: Allow haproxy to listen on required ports
|
|
seport:
|
|
setype: http_port_t
|
|
ports: ["80", "443", "6443", "22623"]
|
|
proto: tcp
|
|
|
|
- name: Haproxy configuration
|
|
template:
|
|
src: haproxy.cfg.j2
|
|
dest: /etc/haproxy/haproxy.cfg
|
|
mode: 0644
|
|
notify: Reload haproxy
|
|
|
|
- name: Haproxy service
|
|
service:
|
|
name: haproxy
|
|
enabled: true
|
|
state: started
|