communishift: add keepalived and mod so it can handle 2 ips.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
This commit is contained in:
Kevin Fenzi 2019-05-11 20:23:41 +00:00
parent 261648a5c4
commit 504053f36f
4 changed files with 50 additions and 0 deletions

View file

@ -16,3 +16,15 @@ nrpe_procs_warn: 1200
nrpe_procs_crit: 1400
vpn: false
# Keepalived variables for os
keepalived_interface: eth0
keepalived_priority: 100
keepalived_ipaddress: 38.145.48.40
keepalived_routerid: 20
# Keepalived variables for app.os
keepalived2_interface: eth0
keepalived2_priority: 50
keepalived2_ipaddress: 38.145.48.41
keepalived2_routerid: 25

View file

@ -16,3 +16,15 @@ nrpe_procs_warn: 1200
nrpe_procs_crit: 1400
vpn: false
# Keepalived variables for os
keepalived_interface: eth0
keepalived_priority: 50
keepalived_ipaddress: 38.145.48.40
keepalived_routerid: 20
# Keepalived variables for app.os
keepalived2_interface: eth0
keepalived2_priority: 100
keepalived2_ipaddress: 38.145.48.41
keepalived2_routerid: 25

View file

@ -23,6 +23,7 @@
- nagios_client
- collectd/base
- sudo
- keepalived
tasks:
- import_tasks: "{{ tasks_path }}/2fa_client.yml"

View file

@ -29,3 +29,28 @@ vrrp_instance VI_1 {
{{ keepalived_ipaddress }}
}
}
{% if keepalived2_ipaddress %}
vrrp_instance VI_1 {
# initial state
state MASTER
interface {{ keepalived2_interface }}
# arbitary unique number 0..255
# used to differentiate multiple instances of vrrpd
virtual_router_id {{ keepalived2_routerid }}
# for electing MASTER, highest priority wins.
# to be MASTER, make 50 more than other machines.
priority {{ keepalived2_priority }}
#
# On master/backup changes, add/remove cron jobs and kojira
#
notify /usr/local/bin/keepalived2-notify.sh
#
# On stop/shutdown, do the same things as moving to MASTER
#
notify_stop "/usr/local/bin/keepalived2-notify.sh type VI_1 MASTER PRI"
virtual_ipaddress {
{{ keepalived2_ipaddress }}
}
}
{% endif %}