[EVO] Nettoyer le playbook

This commit is contained in:
pulsar89.5 2023-10-10 15:22:58 +02:00
parent 0d4cd47771
commit 6995576e07
3 changed files with 18 additions and 16 deletions

View File

@ -13,7 +13,8 @@ keepalived_ipv6: ""
keepalived_peers: [] keepalived_peers: []
keepalived_notify_script_enabled: false keepalived_sudoers_src: ""
keepalived_notify_script_src: ""
keepalived_track_scripts: [] keepalived_track_scripts: []
# Exemple: # Exemple:

View File

@ -16,24 +16,25 @@
become: true become: true
notify: Redémarrer keepalived.service 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 - name: Déployer le fichier de configuration de sudoers
ansible.builtin.copy: ansible.builtin.copy:
src: keepalived/sudoers src: "{{ keepalived_sudoers_src }}"
dest: /etc/sudoers.d/keepalived dest: /etc/sudoers.d/keepalived_script
owner: root owner: root
group: root group: root
mode: u=rw,g=r,o=r mode: u=rw,g=r,o=r
validate: /usr/sbin/visudo -cf %s validate: /usr/sbin/visudo -cf %s
when: "'keepalived/sudoers' is file" when: keepalived_sudoers_src is file
become: true become: true
notify: Redémarrer keepalived.service
- name: Déployer les scripts
ansible.builtin.copy:
src: "{{ keepalived_notify_script_src }}"
dest: /etc/keepalived/
owner: keepalived_script
group: keepalived_script
mode: u=rx,g=rx,o=
when: keepalived_notify_script_src is file
become: true
notify: Redémarrer keepalived.service

View File

@ -64,7 +64,7 @@ vrrp_instance VIP_{{ keepalived_uid }} {
} }
{% endif %} {% endif %}
{% if keepalived_notify_script_enabled %} {% if keepalived_notify_script_src | length > 0 %}
notify /etc/keepalived/notify.sh notify /etc/keepalived/notify.sh
{% endif %} {% endif %}