2023-04-12 12:09:46 +00:00
|
|
|
---
|
|
|
|
# tasks file for keepalived
|
|
|
|
|
2023-04-21 14:32:34 +00:00
|
|
|
- name: Installer le paquet
|
2023-04-12 12:09:46 +00:00
|
|
|
ansible.builtin.apt:
|
|
|
|
name: keepalived
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Déployer la configuration
|
|
|
|
ansible.builtin.template:
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: u=rw,g=r,o=r
|
|
|
|
src: keepalived.j2
|
|
|
|
dest: /etc/keepalived/keepalived.conf
|
|
|
|
become: true
|
|
|
|
notify: Redémarrer keepalived.service
|
2023-04-21 14:32:34 +00:00
|
|
|
|
|
|
|
- name: Déployer les scripts
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: keepalived/notify.sh
|
|
|
|
dest: /etc/keepalived/
|
|
|
|
owner: keepalived_script
|
|
|
|
group: keepalived_script
|
|
|
|
mode: u=rx,g=rx,o=
|
|
|
|
when: keepalived_notify_script_enabled
|
|
|
|
become: true
|
|
|
|
notify: Redémarrer keepalived.service
|
|
|
|
|
|
|
|
- name: Déployer le fichier de configuration de sudoers
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: keepalived/sudoers
|
|
|
|
dest: /etc/sudoers.d/keepalived
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: u=rw,g=r,o=r
|
|
|
|
validate: /usr/sbin/visudo -cf %s
|
2023-09-26 14:40:09 +00:00
|
|
|
when: "'keepalived/sudoers' is file"
|
2023-04-21 14:32:34 +00:00
|
|
|
become: true
|