You've already forked role_keepalived
[EVO] Nettoyer le playbook
This commit is contained in:
@@ -64,8 +64,8 @@ vrrp_instance VIP_{{ keepalived_uid }} {
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
{% if keepalived_notify_script_enabled %}
|
||||
notify /etc/keepalived/notify.sh
|
||||
{% if keepalived_notify_enable %}
|
||||
notify /etc/keepalived/notify.bash
|
||||
{% endif %}
|
||||
|
||||
{% if keepalived_track_scripts | length > 0 %}
|
||||
|
38
templates/notify.bash.j2
Normal file
38
templates/notify.bash.j2
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
# {{ ansible_managed }}
|
||||
|
||||
TYPE=$1
|
||||
NAME=$2
|
||||
STATE=$3
|
||||
|
||||
{% if keepalived_notify_pre | length > 0 %}
|
||||
{{ keepalived_notify_pre }}
|
||||
{% endif %}
|
||||
|
||||
# Use keepalived state
|
||||
case $STATE in
|
||||
{% if keepalived_notify_is_master | length > 0 %}
|
||||
"MASTER")
|
||||
{{ keepalived_notify_is_master | indent(4) }}
|
||||
exit 0
|
||||
;;
|
||||
{% endif %}
|
||||
{% if keepalived_notify_is_backup | length > 0 %}
|
||||
"BACKUP")
|
||||
{{ keepalived_notify_is_backup | indent(4) }}
|
||||
exit 0
|
||||
;;
|
||||
{% endif %}
|
||||
{% if keepalived_notify_is_fault | length > 0 %}
|
||||
"FAULT")
|
||||
{{ keepalived_notify_is_fault | indent(4) }}
|
||||
exit 0
|
||||
;;
|
||||
{% endif %}
|
||||
{% if keepalived_notify_by_default | length > 0 %}
|
||||
*)
|
||||
{{ keepalived_notify_by_default | indent(4) }}
|
||||
exit 1
|
||||
;;
|
||||
{% endif %}
|
||||
esac
|
5
templates/sudoers.j2
Normal file
5
templates/sudoers.j2
Normal file
@@ -0,0 +1,5 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
{% for cmd in keepalived_sudoers_cmd %}
|
||||
keepalived_script ALL=(ALL) NOPASSWD:{{ cmd }}
|
||||
{% endfor %}
|
Reference in New Issue
Block a user