Split haproxy and keepalived restarts
We need this to be stop-start as haproxy and proxysql need to be reconfigured simultaneously when switching between them. This change also introduces checks for service enablement. Co-Authored-By: Radosław Piliszek <radoslaw.piliszek@gmail.com> Change-Id: I2e10f490305f3d8b1b7abbc66ddb40df65c37fe7
This commit is contained in:
parent
28b4c5d35c
commit
959b7f7921
@ -46,7 +46,26 @@
|
|||||||
listen:
|
listen:
|
||||||
- Restart keepalived container
|
- Restart keepalived container
|
||||||
|
|
||||||
- name: Restart backup haproxy container
|
# NOTE(yoctozepto): We need the following to be stop-start as haproxy and
|
||||||
|
# proxysql need to be reconfigured simultaneously when switching between them.
|
||||||
|
|
||||||
|
- name: Stop backup haproxy container
|
||||||
|
become: true
|
||||||
|
kolla_docker:
|
||||||
|
action: "stop_container"
|
||||||
|
# NOTE(kevko): backup node might not have haproxy yet - ignore
|
||||||
|
ignore_missing: true
|
||||||
|
common_options: "{{ docker_common_options }}"
|
||||||
|
name: "haproxy"
|
||||||
|
when:
|
||||||
|
- kolla_action != "config"
|
||||||
|
- groups.kolla_ha_is_master_False is defined
|
||||||
|
- inventory_hostname in groups.kolla_ha_is_master_False
|
||||||
|
listen:
|
||||||
|
- Restart haproxy container
|
||||||
|
- Restart keepalived container
|
||||||
|
|
||||||
|
- name: Start backup haproxy container
|
||||||
vars:
|
vars:
|
||||||
service_name: "haproxy"
|
service_name: "haproxy"
|
||||||
service: "{{ loadbalancer_services[service_name] }}"
|
service: "{{ loadbalancer_services[service_name] }}"
|
||||||
@ -64,6 +83,7 @@
|
|||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
- groups.kolla_ha_is_master_False is defined
|
- groups.kolla_ha_is_master_False is defined
|
||||||
- inventory_hostname in groups.kolla_ha_is_master_False
|
- inventory_hostname in groups.kolla_ha_is_master_False
|
||||||
|
- service.enabled | bool
|
||||||
listen:
|
listen:
|
||||||
- Restart haproxy container
|
- Restart haproxy container
|
||||||
- Restart keepalived container
|
- Restart keepalived container
|
||||||
@ -92,6 +112,7 @@
|
|||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
- groups.kolla_ha_is_master_False is defined
|
- groups.kolla_ha_is_master_False is defined
|
||||||
- inventory_hostname in groups.kolla_ha_is_master_False
|
- inventory_hostname in groups.kolla_ha_is_master_False
|
||||||
|
- service.enabled | bool
|
||||||
listen:
|
listen:
|
||||||
- Restart keepalived container
|
- Restart keepalived container
|
||||||
notify:
|
notify:
|
||||||
@ -103,6 +124,8 @@
|
|||||||
become: true
|
become: true
|
||||||
kolla_docker:
|
kolla_docker:
|
||||||
action: "stop_container"
|
action: "stop_container"
|
||||||
|
# NOTE(yoctozepto): master node might not have haproxy yet - ignore
|
||||||
|
ignore_missing: true
|
||||||
common_options: "{{ docker_common_options }}"
|
common_options: "{{ docker_common_options }}"
|
||||||
name: "haproxy"
|
name: "haproxy"
|
||||||
when:
|
when:
|
||||||
@ -143,6 +166,7 @@
|
|||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
- groups.kolla_ha_is_master_True is defined
|
- groups.kolla_ha_is_master_True is defined
|
||||||
- inventory_hostname in groups.kolla_ha_is_master_True
|
- inventory_hostname in groups.kolla_ha_is_master_True
|
||||||
|
- service.enabled | bool
|
||||||
listen:
|
listen:
|
||||||
- Restart haproxy container
|
- Restart haproxy container
|
||||||
- Restart keepalived container
|
- Restart keepalived container
|
||||||
@ -171,12 +195,20 @@
|
|||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
- groups.kolla_ha_is_master_True is defined
|
- groups.kolla_ha_is_master_True is defined
|
||||||
- inventory_hostname in groups.kolla_ha_is_master_True
|
- inventory_hostname in groups.kolla_ha_is_master_True
|
||||||
|
- service.enabled | bool
|
||||||
listen:
|
listen:
|
||||||
- Restart keepalived container
|
- Restart keepalived container
|
||||||
notify:
|
notify:
|
||||||
- Wait for virtual IP to appear
|
- Wait for virtual IP to appear
|
||||||
|
|
||||||
- name: Wait for virtual IP to appear
|
- name: Wait for haproxy to listen on VIP
|
||||||
|
vars:
|
||||||
|
service_name: "haproxy"
|
||||||
|
service: "{{ loadbalancer_services[service_name] }}"
|
||||||
wait_for:
|
wait_for:
|
||||||
host: "{{ kolla_internal_vip_address }}"
|
host: "{{ kolla_internal_vip_address }}"
|
||||||
port: "{{ haproxy_monitor_port }}"
|
port: "{{ haproxy_monitor_port }}"
|
||||||
|
when:
|
||||||
|
- service.enabled | bool
|
||||||
|
listen:
|
||||||
|
- Wait for virtual IP to appear
|
||||||
|
Loading…
x
Reference in New Issue
Block a user