[EVO] Ajouter les scripts de notifications

This commit is contained in:
2023-04-21 16:32:34 +02:00
parent 4bc5f1e12a
commit d029004767
4 changed files with 60 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
---
# tasks file for keepalived
- name: Installer keepalived
- name: Installer le paquet
ansible.builtin.apt:
name: keepalived
become: true
@@ -15,3 +15,29 @@
dest: /etc/keepalived/keepalived.conf
become: true
notify: Redémarrer keepalived.service
- name: Créer le dossier de déploiement des scripts
ansible.builtin.file:
path: /srv/keepalived
owner: root
group: root
mode: u=rwX,g=rX,o=
state: directory
when: keepalived_scripts_path | length > 0
become: true
- name: Déployer les scripts
ansible.builtin.copy:
src: keepalived/notify_{{ item | split('_') | last }}.sh
dest: "{{ keepalived_scripts_path }}"
mode: u=r,g=r,o=
when:
- keepalived_scripts_path | length > 0
- vars[item]
loop:
- keepalived_notify_master
- keepalived_notify_backup
- keepalived_notify_fault
- keepalived_notify_stop
become: true
notify: Redémarrer keepalived.service