unicast_peer #2

Merged
pulsar merged 3 commits from unicast_peer into master 2023-09-26 15:13:11 +00:00
3 changed files with 4 additions and 1 deletions
Showing only changes of commit 54e2b70bd6 - Show all commits

View File

@ -15,7 +15,7 @@ galaxy_info:
dependencies: dependencies:
- role: users - role: users
vars: vars:
users: users_role_keepalived:
- name: keepalived_script - name: keepalived_script
comment: "Dedicated user for keepalived script" comment: "Dedicated user for keepalived script"
update_password: on_create update_password: on_create

View File

@ -35,4 +35,5 @@
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"
become: true become: true

View File

@ -13,6 +13,7 @@ global_defs {
smtp_connect_timeout 30 smtp_connect_timeout 30
{% endif %} {% endif %}
script_user keepalived_script
enable_script_security enable_script_security
max_auto_priority 50 max_auto_priority 50
} }
@ -41,6 +42,7 @@ vrrp_instance VIP_{{ keepalived_uid }} {
advert_int 1 advert_int 1
{% if keepalived_peers | length > 0 %} {% if keepalived_peers | length > 0 %}
unicast_src_ip {{ ansible_facts[keepalived_interface]['ipv4']['address'] }}
unicast_peer { unicast_peer {
{% for peer in keepalived_peers %} {% for peer in keepalived_peers %}
{% if peer != ansible_facts[keepalived_interface]['ipv4']['address'] %} {% if peer != ansible_facts[keepalived_interface]['ipv4']['address'] %}