Skip to content

Commit

Permalink
Added timeout, rise and fall options for vrrp_script (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
janneojala authored and tersmitten committed Feb 14, 2018
1 parent 23dfa30 commit 9339a10
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ Set up the latest or a specific version of [Keepalived](http://www.keepalived.or
* `keepalived_vrrp_scripts.key.script`: The script to run periodically
* `keepalived_vrrp_scripts.key.weight`: [optional]: The check weight to adjust the priority
* `keepalived_vrrp_scripts.key.interval`: [optional]: The check interval in seconds
* `keepalived_vrrp_scripts.key.timeout`: [optional]: Seconds after which script is considered to have failed
* `keepalived_vrrp_scripts.key.rise`: [optional]: Required number of successes for OK transition
* `keepalived_vrrp_scripts.key.fall`: [optional]: Required number of successes for KO transition

* `keepalived_vrrp_instances`: [default: `{}`]: VRRP instance declarations
* `keepalived_vrrp_instances.key`: The name of the VRRP instance
Expand Down
9 changes: 9 additions & 0 deletions templates/etc/keepalived/keepalived.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ vrrp_script {{ key }} {
{% if value.interval is defined and value.interval | int %}
interval {{ value.interval }}
{% endif %}
{% if value.timeout is defined and value.timeout | int %}
timeout {{ value.timeout }}
{% endif %}
{% if value.rise is defined and value.rise | int %}
rise {{ value.rise }}
{% endif %}
{% if value.fall is defined and value.fall | int %}
fall {{ value.fall }}
{% endif %}
{% if value.user is defined %}
user {{ value.user }}
{% endif %}
Expand Down
3 changes: 3 additions & 0 deletions tests/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
script: '/bin/pidof sshd'
weight: 2
interval: 1
timeout: 2
rise: 3
fall: 3
# user: "{{ keepalived_global_defs_script_user }}"

keepalived_vrrp_instances:
Expand Down

0 comments on commit 9339a10

Please sign in to comment.