Skip to content

Commit

Permalink
Consistency changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tersmitten committed Apr 12, 2019
1 parent 8bbec90 commit 9df331a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## keepalived

[![Build Status](https://travis-ci.org/Oefenweb/ansible-keepalived.svg?branch=master)](https://travis-ci.org/Oefenweb/ansible-keepalived) [![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-keepalived-blue.svg)](https://galaxy.ansible.com/Oefenweb/keepalived)
[![Build Status](https://travis-ci.org/Oefenweb/ansible-keepalived.svg?branch=master)](https://travis-ci.org/Oefenweb/ansible-keepalived)
[![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-keepalived-blue.svg)](https://galaxy.ansible.com/Oefenweb/keepalived)

Set up the latest or a specific version of [Keepalived](http://www.keepalived.org/) in Debian-like systems.

Expand Down Expand Up @@ -79,6 +80,7 @@ Set up the latest or a specific version of [Keepalived](http://www.keepalived.or
* `keepalived_vrrp_instances.key.notify_master`: [optional]: Scripts that is invoked when a server changes state (to `MASTER`)
* `keepalived_vrrp_instances.key.notify_master_user`: [optional]: Specify the user / group to run this script under (since `1.3.0`)
* `keepalived_vrrp_instances.key.unicast_peer`: [optional]: IP address of aired unicast address (if you don't want to use multicast)

#### Dependencies

None
Expand Down
8 changes: 4 additions & 4 deletions templates/etc/keepalived/keepalived.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ vrrp_instance {{ key }} {
{% endfor %}
}

{% if value.virtual_ipaddresses_excluded | d([]) | length %}
{% if value.virtual_ipaddresses_excluded is defined %}
virtual_ipaddress_excluded {
{% for virtual_ipaddress in value.virtual_ipaddresses_excluded %}
{% for virtual_ipaddress in value.virtual_ipaddresses_excluded | default([]) %}
{{ virtual_ipaddress }}
{% endfor %}
}

{% endif %}

{% if value.nopreempt is defined and value.nopreempt | bool %}
nopreempt
{% endif %}
Expand All @@ -89,7 +89,7 @@ vrrp_instance {{ key }} {
{{ track_script }}
{% endfor %}
}

{% if value.unicast_peer is defined %}
unicast_peer {
{{ value.unicast_peer }}
Expand Down
3 changes: 3 additions & 0 deletions tests/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@

virtual_ipaddresses:
- "10.0.0.10/24 dev {{ _keepalived_second_interface }} label {{ _keepalived_second_interface }}:1"
virtual_ipaddresses_excluded:
- "10.0.0.11/24 dev {{ _keepalived_second_interface }} label {{ _keepalived_second_interface }}:2"
- "10.0.0.12/24 dev {{ _keepalived_second_interface }} label {{ _keepalived_second_interface }}:3"

track_scripts:
- chk_sshd
Expand Down

0 comments on commit 9df331a

Please sign in to comment.