WIP
This commit is contained in:
28
ansible/roles/vip/tasks/main.yml
Normal file
28
ansible/roles/vip/tasks/main.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
- name: Installation des paquetages
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- "keepalived"
|
||||
notify:
|
||||
- "Restart keepalived"
|
||||
|
||||
- name: Tell kernel to allow binding non-local IP
|
||||
ansible.posix.sysctl:
|
||||
name: "net.ipv4.ip_nonlocal_bind"
|
||||
value: "1"
|
||||
sysctl_set: true
|
||||
notify:
|
||||
- "Restart keepalived"
|
||||
|
||||
- name: Generate keepalived.conf file
|
||||
ansible.builtin.template:
|
||||
src: "templates/keepalived.conf"
|
||||
dest: "/etc/keepalived/keepalived.conf"
|
||||
mode: "0640"
|
||||
notify:
|
||||
- "Restart keepalived"
|
||||
|
||||
- name: Activate and start keepalived
|
||||
ansible.builtin.service:
|
||||
name: "keepalived"
|
||||
state: "started"
|
||||
enabled: true
|
||||
Reference in New Issue
Block a user