[EVO] Ajouter les scripts de notifications

This commit is contained in:
2023-04-21 16:32:34 +02:00
parent 4bc5f1e12a
commit eaee8cd2ae
5 changed files with 69 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,31 @@
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=rX
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 }}"
owner: keepalived_script
group: keepalived_script
mode: u=rx,g=rx,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