role_keepalived/tasks/main.yml

40 lines
943 B
YAML

---
# tasks file for keepalived
- name: Installer le paquet
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
- 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
when: "'keepalived/sudoers' is file"
become: true