WIP: support for Quagga failover
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing

This change probably doesn't work
This commit is contained in:
jeltz 2021-02-04 01:48:40 +01:00
parent 0988e8bbd0
commit 1816e0de71
4 changed files with 33 additions and 6 deletions

View file

@ -1,10 +1,5 @@
{% if 'backup' in inventory_hostname %}
bgpd=no
{% else %}
zebra=yes
bgpd=yes bgpd=yes
{% endif %} zebra=yes
ospfd=no ospfd=no
ospf6d=no ospf6d=no
ripd=no ripd=no

View file

@ -75,6 +75,13 @@
notify: restart keepalived notify: restart keepalived
when: "'routeur-aurore' not in ansible_hostname" when: "'routeur-aurore' not in ansible_hostname"
- name: install notify-quagga on routeur-aurore*
template:
src: notify-quagga.j2
dest: /usr/local/sbin/notify-quagga
mode: u=rx,g=r,o=r
when: "'routeur-aurore' in ansible_hostname"
- name: configure keepalived for routeur-aurore* - name: configure keepalived for routeur-aurore*
template: template:
src: keepalived-aurore.conf src: keepalived-aurore.conf

View file

@ -127,5 +127,9 @@ vrrp_instance VI_ROUT_aurore_IPv6 {
2a09:6840:50::/64 via 2a09:6840:129::5:254 dev ens18 2a09:6840:50::/64 via 2a09:6840:129::5:254 dev ens18
2a09:6840:51::/64 via 2a09:6840:129::5:254 dev ens18 2a09:6840:51::/64 via 2a09:6840:129::5:254 dev ens18
} }
notify_master "/usr/local/sbin/notify-quagga master"
notify_backup "/usr/local/sbin/notify-quagga backup"
notify_fault "/usr/local/sbin/notify-quagga fault"
} }

View file

@ -0,0 +1,21 @@
#!/bin/bash
{{ ansible_managed | comment }}
if [[ $# = 0 ]]; then
echo "Invalid number of arguments" >&2
exit 1
fi
case $1 in
master)
systemctl start zebra.service
systemctl start bgpd.service
;;
backup | fault)
systemctl stop zebra.service
systemctl stop bgpd.service
;;
*)
echo "Invalid argument" >&2
exit 1
esac