Skip to content

Commit

Permalink
Consistency changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tersmitten committed Dec 20, 2022
1 parent 86b9432 commit 0cffa13
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ keepalived_vrrp_script_map: {}

keepalived_vrrp_scripts: {}
keepalived_vrrp_track_processes: {}
keepalived_vrrp_sync_groups: {}

keepalived_vrrp_instances: {}
12 changes: 5 additions & 7 deletions templates/etc/keepalived/keepalived.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,12 @@ vrrp_track_process {{ key }} {
}
{% endfor %}

{% if keepalived_vrrp_sync_groups is defined %}
{% for name, sync_group in keepalived_vrrp_sync_groups.items() %}

{% for name, sync_group in keepalived_vrrp_sync_groups.items() | sort %}
vrrp_sync_group {{ name }} {
group {
{% for instance in sync_group.instances -%}
{{ instance }}
{% endfor -%}
{% for instance in sync_group.instances | default([]) %}
{{ instance }}
{% endfor %}
}
{% if sync_group.notify_master is defined %}
notify_master "{{ sync_group.notify_master }}"
Expand All @@ -95,7 +93,7 @@ vrrp_sync_group {{ name }} {
{% endif %}
}
{% endfor %}
{% endif %}

{% for key, value in keepalived_vrrp_instances.items() | sort %}
vrrp_instance {{ key }} {
interface {{ value.interface }}
Expand Down
5 changes: 5 additions & 0 deletions tests/vars/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,8 @@ keepalived_vrrp_instances:

# notify: "{{ keepalived_vrrp_script_map['keepalived-notify']['dest'] }}"
# notify_user: root

#keepalived_vrrp_sync_groups:
# VG_1:
# instances:
# - VI_1

0 comments on commit 0cffa13

Please sign in to comment.