67 lines
1.1 KiB
YAML
67 lines
1.1 KiB
YAML
|
---
|
||
|
- name: Install software
|
||
|
package:
|
||
|
name: "{{ item }}"
|
||
|
state: latest
|
||
|
with_items: "{{ haproxy_packages }}"
|
||
|
notify: Restart RSyslog
|
||
|
|
||
|
|
||
|
- name: HAProxy create config
|
||
|
template:
|
||
|
dest: "/etc/haproxy/haproxy.cfg"
|
||
|
src: "haproxy.cfg.j2"
|
||
|
mode: 0644
|
||
|
backup: yes
|
||
|
notify:
|
||
|
- Restart HAProxy
|
||
|
- Restart RSyslog
|
||
|
|
||
|
|
||
|
- name: Create Rsyslog config dir
|
||
|
file:
|
||
|
dest: /etc/rsyslog.d/
|
||
|
state: directory
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0644
|
||
|
|
||
|
|
||
|
- name: Rsyslog create config
|
||
|
template:
|
||
|
dest: "/etc/rsyslog.d/haproxy.conf"
|
||
|
src: "rsyslog.conf.j2"
|
||
|
mode: 0644
|
||
|
backup: yes
|
||
|
notify:
|
||
|
- Restart RSyslog
|
||
|
|
||
|
|
||
|
- name: Create jail /dev directory
|
||
|
file:
|
||
|
path: /var/lib/haproxy/dev/
|
||
|
state: directory
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0755
|
||
|
|
||
|
|
||
|
- name: Copy SSL certificate
|
||
|
copy:
|
||
|
src: "{{ haproxy_sslcert_src }}"
|
||
|
dest: "{{ haproxy_sslcert_path }}"
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0600
|
||
|
backup: yes
|
||
|
when: haproxy_sslcert_src|default("") != ""
|
||
|
|
||
|
|
||
|
- name: HAProxy enable service
|
||
|
service:
|
||
|
name: haproxy
|
||
|
enabled: yes
|
||
|
state: started
|
||
|
|
||
|
|