feat: initial commit
This commit is contained in:
parent
e19f269ec5
commit
214e91a391
16 changed files with 546 additions and 93 deletions
12
tasks/config.yaml
Normal file
12
tasks/config.yaml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
|
||||
# configure haproxy.cfg
|
||||
- name: "config - haproxy.cfg"
|
||||
ansible.builtin.template:
|
||||
src: "templates/haproxy.cfg.j2"
|
||||
dest: "/etc/haproxy/haproxy.cfg"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
validate: "haproxy -c -f %s"
|
||||
notify: "restart haproxy"
|
||||
16
tasks/install.yaml
Normal file
16
tasks/install.yaml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
|
||||
# install haproxy
|
||||
- name: "install - haproxy"
|
||||
ansible.builtin.apt:
|
||||
name: "haproxy"
|
||||
state: "latest"
|
||||
cache_valid_time: "120"
|
||||
when: 'ansible_os_family == "Debian"'
|
||||
|
||||
# start haproxy service
|
||||
- name: "service - start haproxy"
|
||||
ansible.builtin.systemd:
|
||||
name: "haproxy"
|
||||
state: "started"
|
||||
enabled: true
|
||||
9
tasks/main.yaml
Normal file
9
tasks/main.yaml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
|
||||
# install haproxy
|
||||
- name: "install"
|
||||
ansible.builtin.import_tasks: "install.yaml"
|
||||
|
||||
# configure haproxy
|
||||
- name: "config"
|
||||
ansible.builtin.import_tasks: "config.yaml"
|
||||
Loading…
Add table
Add a link
Reference in a new issue