Merge "HAProxy: expose stats socket in HA deployment after upgrade"
This commit is contained in:
commit
1058f6aa17
|
@ -143,6 +143,9 @@ outputs:
|
||||||
optional: true
|
optional: true
|
||||||
preserve_properties: true
|
preserve_properties: true
|
||||||
permissions:
|
permissions:
|
||||||
|
- path: /var/lib/haproxy
|
||||||
|
owner: haproxy:haproxy
|
||||||
|
recurse: true
|
||||||
- path:
|
- path:
|
||||||
list_join:
|
list_join:
|
||||||
- ''
|
- ''
|
||||||
|
@ -216,6 +219,13 @@ outputs:
|
||||||
- /usr/libexec/initscripts/legacy-actions:/usr/libexec/initscripts/legacy-actions:ro
|
- /usr/libexec/initscripts/legacy-actions:/usr/libexec/initscripts/legacy-actions:ro
|
||||||
- /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro
|
- /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro
|
||||||
- /dev/shm:/dev/shm:rw
|
- /dev/shm:/dev/shm:rw
|
||||||
|
host_prep_tasks:
|
||||||
|
- name: create persistent directories
|
||||||
|
file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- /var/lib/haproxy
|
||||||
metadata_settings:
|
metadata_settings:
|
||||||
get_attr: [HAProxyBase, role_data, metadata_settings]
|
get_attr: [HAProxyBase, role_data, metadata_settings]
|
||||||
update_tasks:
|
update_tasks:
|
||||||
|
@ -258,11 +268,6 @@ outputs:
|
||||||
- name: Check if haproxy is already containerized
|
- name: Check if haproxy is already containerized
|
||||||
set_fact:
|
set_fact:
|
||||||
haproxy_containerized: "{{haproxy_kolla_config.stat.isdir | default(false)}}"
|
haproxy_containerized: "{{haproxy_kolla_config.stat.isdir | default(false)}}"
|
||||||
- name: haproxy baremetal to container upgrade tasks
|
|
||||||
when:
|
|
||||||
- step|int == 1
|
|
||||||
- not haproxy_containerized|bool
|
|
||||||
block:
|
|
||||||
- name: get bootstrap nodeid
|
- name: get bootstrap nodeid
|
||||||
tags: common
|
tags: common
|
||||||
command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid
|
command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid
|
||||||
|
@ -270,6 +275,11 @@ outputs:
|
||||||
- name: set is_bootstrap_node fact
|
- name: set is_bootstrap_node fact
|
||||||
tags: common
|
tags: common
|
||||||
set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
|
set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
|
||||||
|
- name: haproxy baremetal to container upgrade tasks
|
||||||
|
when:
|
||||||
|
- step|int == 1
|
||||||
|
- not haproxy_containerized|bool
|
||||||
|
block:
|
||||||
- name: Check cluster resource status
|
- name: Check cluster resource status
|
||||||
pacemaker_resource:
|
pacemaker_resource:
|
||||||
resource: {get_attr: [HAProxyBase, role_data, service_name]}
|
resource: {get_attr: [HAProxyBase, role_data, service_name]}
|
||||||
|
@ -295,6 +305,38 @@ outputs:
|
||||||
register: output
|
register: output
|
||||||
retries: 5
|
retries: 5
|
||||||
until: output.rc == 0
|
until: output.rc == 0
|
||||||
|
- name: Expose HAProxy stats socket on the host
|
||||||
|
when:
|
||||||
|
- step|int == 1
|
||||||
|
- haproxy_containerized|bool
|
||||||
|
- is_bootstrap_node
|
||||||
|
block:
|
||||||
|
- name: Check haproxy stats socket configuration in pacemaker
|
||||||
|
command: cibadmin --query --xpath "//storage-mapping[@id='haproxy-var-lib']"
|
||||||
|
ignore_errors: true
|
||||||
|
register: haproxy_stats_exposed
|
||||||
|
- name: Change haproxy stats socket configuration in pacemaker
|
||||||
|
# rc == 6 means the configuration doesn't exist in the CIB
|
||||||
|
when: haproxy_stats_exposed.rc == 6
|
||||||
|
block:
|
||||||
|
- name: Disable the haproxy cluster resource
|
||||||
|
pacemaker_resource:
|
||||||
|
resource: haproxy-bundle
|
||||||
|
state: disable
|
||||||
|
wait_for_resource: true
|
||||||
|
register: output
|
||||||
|
retries: 5
|
||||||
|
until: output.rc == 0
|
||||||
|
- name: Add a bind mount for stats socket in the haproxy bundle
|
||||||
|
command: pcs resource bundle update haproxy-bundle storage-map add id=haproxy-var-lib source-dir=/var/lib/haproxy target-dir=/var/lib/haproxy options=rw
|
||||||
|
- name: Enable the haproxy cluster resource
|
||||||
|
pacemaker_resource:
|
||||||
|
resource: haproxy-bundle
|
||||||
|
state: enable
|
||||||
|
wait_for_resource: true
|
||||||
|
register: output
|
||||||
|
retries: 5
|
||||||
|
until: output.rc == 0
|
||||||
- name: Retag the pacemaker image if containerized
|
- name: Retag the pacemaker image if containerized
|
||||||
when:
|
when:
|
||||||
- step|int == 3
|
- step|int == 3
|
||||||
|
|
Loading…
Reference in New Issue