Some changes in keepalived template

certbot_on_virtu
Alexandre Iooss 2020-05-03 10:03:12 +02:00
parent cea6c04650
commit b3619d05f4
No known key found for this signature in database
GPG Key ID: 6C79278F3FCDCC02
3 changed files with 17 additions and 25 deletions

View File

@ -11,7 +11,6 @@
router: true router: true
router_password: "{{ vault_keepalived_router_password }}" router_password: "{{ vault_keepalived_router_password }}"
router_primary: false router_primary: false
proxy: false
if_serveurs: eth0.1 if_serveurs: eth0.1
if_adm: eth0.2 if_adm: eth0.2
if_bornes: eth0.3 if_bornes: eth0.3
@ -55,11 +54,9 @@
- hosts: gulp.adm.crans.org - hosts: gulp.adm.crans.org
vars: vars:
keepalived: keepalived:
radius: false
router: true router: true
router_password: "{{ vault_keepalived_router_password }}" router_password: "{{ vault_keepalived_router_password }}"
router_primary: true router_primary: true
proxy: false
if_serveurs: eno1.1 if_serveurs: eno1.1
if_adm: eno1.2 if_adm: eno1.2
if_bornes: eno1.3 if_bornes: eno1.3
@ -93,15 +90,13 @@
- hosts: frontdaur.adm.crans.org - hosts: frontdaur.adm.crans.org
vars: vars:
keepalived: keepalived:
radius: false proxy:
router: false primary: false
proxy: true password: "{{ vault_keepalived_proxy_password }}"
proxy_primary: false ipv4: 185.230.79.194
proxy_password: "{{ vault_keepalived_proxy_password }}" ipv6: 2a0c:700:0:24:ba:ccff:feda:aa00
broadcast: 185.230.79.255
if_adm: eth1 if_adm: eth1
if_srv: eth0 if_srv: eth0
proxy_ipv4_srv: 185.230.79.194
proxy_broadcast_srv: 185.230.79.255
proxy_ipv6_srv: 2a0c:700:0:24:ba:ccff:feda:aa00
roles: roles:
- keepalived - keepalived

View File

@ -2,8 +2,7 @@
- name: Install keepalived - name: Install keepalived
apt: apt:
update_cache: true update_cache: true
name: name: keepalived
- keepalived
register: apt_result register: apt_result
retries: 3 retries: 3
until: apt_result is succeeded until: apt_result is succeeded

View File

@ -8,11 +8,11 @@ global_defs {
smtp_server smtp.adm.crans.org smtp_server smtp.adm.crans.org
} }
{% if keepalived.proxy %} {% if keepalived.proxy is defined %}
vrrp_instance VI_DAUR4 { vrrp_instance VI_DAUR4 {
# We don't own the IP address, which allows manual triggering of IP change when machine comes UP # We don't own the IP address, which allows manual triggering of IP change when machine comes UP
# see man keepalived.conf. # see man keepalived.conf.
{% if keepalived.proxy_primary %} {% if keepalived.proxy.primary %}
state MASTER state MASTER
priority 150 priority 150
{% else %} {% else %}
@ -25,20 +25,18 @@ vrrp_instance VI_DAUR4 {
advert_int 2 advert_int 2
authentication { authentication {
auth_type PASS auth_type PASS
auth_pass {{ keepalived.proxy_password }} auth_pass {{ keepalived.proxy.password }}
} }
virtual_ipaddress { virtual_ipaddress {
{{ keepalived.proxy_ipv4 }}/32 brd 138.231.143.255 dev eth0 scope global {{ keepalived.proxy.ipv4 }}/32 brd {{ keepalived.proxy.broadcast }} dev {{ keepalived.if_srv }} scope global
} }
} }
{% endif %}
{% if keepalived.proxy %}
vrrp_instance VI_DAUR6 { vrrp_instance VI_DAUR6 {
# We don't own the IP address, which allows manual triggering of IP change when machine comes UP # We don't own the IP address, which allows manual triggering of IP change when machine comes UP
# see man keepalived.conf. # see man keepalived.conf.
{% if keepalived.proxy_primary %} {% if keepalived.proxy.primary %}
state MASTER state MASTER
priority 150 priority 150
{% else %} {% else %}
@ -51,16 +49,16 @@ vrrp_instance VI_DAUR6 {
advert_int 2 advert_int 2
authentication { authentication {
auth_type PASS auth_type PASS
auth_pass {{ keepalived.proxy_password }} auth_pass {{ keepalived.proxy.password }}
} }
virtual_ipaddress { virtual_ipaddress {
{{ keepalived.proxy_ipv6 }}/64 dev eth0 scope global {{ keepalived.proxy.ipv6 }}/64 dev {{ keepalived.if_srv }} scope global
} }
} }
{% endif %} {% endif %}
{% if keepalived.radius %} {% if keepalived.radius is defined %}
vrrp_instance VI_RAD4 { vrrp_instance VI_RAD4 {
# We don't own the IP address, which allows manual triggering of IP change when machine comes UP # We don't own the IP address, which allows manual triggering of IP change when machine comes UP
# see man keepalived.conf. # see man keepalived.conf.
@ -90,7 +88,7 @@ vrrp_instance VI_RAD4 {
} }
{% endif %} {% endif %}
{% if keepalived.radius %} {% if keepalived.radius is defined %}
vrrp_instance VI_RAD6 { vrrp_instance VI_RAD6 {
# We don't own the IP address, which allows manual triggering of IP change when machine comes UP # We don't own the IP address, which allows manual triggering of IP change when machine comes UP
# see man keepalived.conf. # see man keepalived.conf.
@ -120,7 +118,7 @@ vrrp_instance VI_RAD6 {
} }
{% endif %} {% endif %}
{% if keepalived.router %} {% if keepalived.router is defined %}
vrrp_instance VI_ROUT { vrrp_instance VI_ROUT {
# We don't own the IP address, which allows manual triggering of IP change when machine comes UP # We don't own the IP address, which allows manual triggering of IP change when machine comes UP
# see man keepalived.conf. # see man keepalived.conf.