role_keepalived/tasks/main.yml

41 lines
1001 B
YAML
Raw Normal View History

2023-04-12 12:09:46 +00:00
---
# tasks file for keepalived
- 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:
2023-10-10 13:22:58 +00:00
src: keepalived.j2
dest: /etc/keepalived/keepalived.conf
2023-04-12 12:09:46 +00:00
owner: root
group: root
mode: u=rw,g=r,o=r
become: true
notify: Redémarrer keepalived.service
2023-10-10 13:22:58 +00:00
- name: Déployer le fichier de configuration de sudoers
ansible.builtin.template:
src: sudoers.j2
dest: /etc/sudoers.d/keepalived_script
owner: root
group: keepalived_script
2023-10-10 13:22:58 +00:00
mode: u=rwx,g=rx,o=
validate: /usr/sbin/visudo -cf %s
when: keepalived_sudoers_cmd | length > 0
become: true
notify: Redémarrer keepalived.service
2023-10-10 13:22:58 +00:00
- name: Déployer les scripts
ansible.builtin.template:
src: notify.bash.j2
dest: /etc/keepalived/notify.bash
owner: root
2023-10-10 13:22:58 +00:00
group: keepalived_script
mode: u=rwx,g=rx,o=
when: keepalived_notify | length > 0
become: true
2023-10-10 13:22:58 +00:00
notify: Redémarrer keepalived.service