Remove non-containerized pacemaker resources on upgrade
Adds upgrade_tasks to remove the pacemaker resources using the ansible-pacemaker module. Resources are disabled and removed in step2 (called only on bootstrap node) and then the cluster stop is moved to step3 The existing systemd/service call is kept but only to disable services after they are disabled/deleted from the cluster. Related-Bug: 1701485 Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com> Change-Id: Ia597d240ea5834c50a8f6c4fac0b6ed417b8535c
This commit is contained in:
parent
a34955d451
commit
cdc3477b77
@ -139,6 +139,27 @@ outputs:
|
||||
- /var/lib/cinder
|
||||
- /var/log/containers/cinder
|
||||
upgrade_tasks:
|
||||
- name: Stop and disable cinder_backup service
|
||||
- name: get bootstrap nodeid
|
||||
tags: common
|
||||
command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid
|
||||
register: bootstrap_node
|
||||
- name: set is_bootstrap_node fact
|
||||
tags: common
|
||||
set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
|
||||
- name: Disable the openstack-cinder-backup cluster resource
|
||||
tags: step2
|
||||
service: name=openstack-cinder-backup state=stopped enabled=no
|
||||
pacemaker_resource:
|
||||
resource: openstack-cinder-backup
|
||||
state: disable
|
||||
wait_for_resource: true
|
||||
when: is_bootstrap_node
|
||||
- name: Delete the stopped openstack-cinder-backup cluster resource.
|
||||
tags: step2
|
||||
pacemaker_resource:
|
||||
resource: openstack-cinder-backup
|
||||
state: delete
|
||||
wait_for_resource: true
|
||||
when: is_bootstrap_node
|
||||
- name: Disable cinder_backup service
|
||||
tags: step2
|
||||
service: name=openstack-cinder-backup enabled=no
|
||||
|
@ -157,6 +157,30 @@ outputs:
|
||||
executable: /bin/bash
|
||||
creates: /dev/loop2
|
||||
upgrade_tasks:
|
||||
- name: Stop and disable cinder_volume service
|
||||
- name: get bootstrap nodeid
|
||||
tags: common
|
||||
command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid
|
||||
register: bootstrap_node
|
||||
- name: set is_bootstrap_node fact
|
||||
tags: common
|
||||
set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
|
||||
- name: Disable the openstack-cinder-volume cluster resource
|
||||
tags: step2
|
||||
service: name=openstack-cinder-volume state=stopped enabled=no
|
||||
pacemaker_resource:
|
||||
resource: openstack-cinder-volume
|
||||
state: disable
|
||||
wait_for_resource: true
|
||||
when: is_bootstrap_node
|
||||
- name: Delete the stopped openstack-cinder-volume cluster resource.
|
||||
tags: step2
|
||||
pacemaker_resource:
|
||||
resource: openstack-cinder-volume
|
||||
state: delete
|
||||
wait_for_resource: true
|
||||
when: is_bootstrap_node
|
||||
- name: Disable cinder_volume service from boot
|
||||
tags: step2
|
||||
service: name=openstack-cinder-volume enabled=no
|
||||
|
||||
|
||||
|
||||
|
@ -164,6 +164,27 @@ outputs:
|
||||
path: /var/lib/mysql
|
||||
state: directory
|
||||
upgrade_tasks:
|
||||
- name: Stop and disable mysql service
|
||||
- name: get bootstrap nodeid
|
||||
tags: common
|
||||
command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid
|
||||
register: bootstrap_node
|
||||
- name: set is_bootstrap_node fact
|
||||
tags: common
|
||||
set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
|
||||
- name: Disable the galera cluster resource
|
||||
tags: step2
|
||||
service: name=mariadb state=stopped enabled=no
|
||||
pacemaker_resource:
|
||||
resource: galera
|
||||
state: disable
|
||||
wait_for_resource: true
|
||||
when: is_bootstrap_node
|
||||
- name: Delete the stopped galera cluster resource.
|
||||
tags: step2
|
||||
pacemaker_resource:
|
||||
resource: galera
|
||||
state: delete
|
||||
wait_for_resource: true
|
||||
when: is_bootstrap_node
|
||||
- name: Disable mysql service
|
||||
tags: step2
|
||||
service: name=mariadb enabled=no
|
||||
|
@ -139,6 +139,27 @@ outputs:
|
||||
path: /var/lib/redis
|
||||
state: directory
|
||||
upgrade_tasks:
|
||||
- name: Stop and disable redis service
|
||||
- name: get bootstrap nodeid
|
||||
tags: common
|
||||
command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid
|
||||
register: bootstrap_node
|
||||
- name: set is_bootstrap_node fact
|
||||
tags: common
|
||||
set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
|
||||
- name: Disable the redis cluster resource
|
||||
tags: step2
|
||||
service: name=redis state=stopped enabled=no
|
||||
pacemaker_resource:
|
||||
resource: {get_attr: [RedisBase, role_data, service_name]}
|
||||
state: disable
|
||||
wait_for_resource: true
|
||||
when: is_bootstrap_node
|
||||
- name: Delete the stopped redis cluster resource.
|
||||
tags: step2
|
||||
pacemaker_resource:
|
||||
resource: {get_attr: [RedisBase, role_data, service_name]}
|
||||
state: delete
|
||||
wait_for_resource: true
|
||||
when: is_bootstrap_node
|
||||
- name: Disable redis service
|
||||
tags: step2
|
||||
service: name=redis enabled=no
|
||||
|
@ -137,3 +137,25 @@ outputs:
|
||||
- /dev/shm:/dev/shm:rw
|
||||
metadata_settings:
|
||||
get_attr: [HAProxyBase, role_data, metadata_settings]
|
||||
upgrade_tasks:
|
||||
- name: get bootstrap nodeid
|
||||
tags: common
|
||||
command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid
|
||||
register: bootstrap_node
|
||||
- name: set is_bootstrap_node fact
|
||||
tags: common
|
||||
set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
|
||||
- name: Disable the haproxy cluster resource.
|
||||
tags: step2
|
||||
pacemaker_resource:
|
||||
resource: {get_attr: [HAProxyBase, role_data, service_name]}
|
||||
state: disable
|
||||
wait_for_resource: true
|
||||
when: is_bootstrap_node
|
||||
- name: Delete the stopped haproxy cluster resource.
|
||||
tags: step2
|
||||
pacemaker_resource:
|
||||
resource: {get_attr: [HAProxyBase, role_data, service_name]}
|
||||
state: delete
|
||||
wait_for_resource: true
|
||||
when: is_bootstrap_node
|
||||
|
@ -157,6 +157,27 @@ outputs:
|
||||
echo 'export ERL_EPMD_PORT=4370' >> /etc/rabbitmq/rabbitmq-env.conf
|
||||
for pid in $(pgrep epmd); do if [ "$(lsns -o NS -p $pid)" == "$(lsns -o NS -p 1)" ]; then kill $pid; break; fi; done
|
||||
upgrade_tasks:
|
||||
- name: Stop and disable rabbitmq service
|
||||
- name: get bootstrap nodeid
|
||||
tags: common
|
||||
command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid
|
||||
register: bootstrap_node
|
||||
- name: set is_bootstrap_node fact
|
||||
tags: common
|
||||
set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
|
||||
- name: Disable the rabbitmq cluster resource.
|
||||
tags: step2
|
||||
service: name=rabbitmq-server state=stopped enabled=no
|
||||
pacemaker_resource:
|
||||
resource: {get_attr: [RabbitmqBase, role_data, service_name]}
|
||||
state: disable
|
||||
wait_for_resource: true
|
||||
when: is_bootstrap_node
|
||||
- name: Delete the stopped rabbitmq cluster resource.
|
||||
tags: step2
|
||||
pacemaker_resource:
|
||||
resource: {get_attr: [RabbitmqBase, role_data, service_name]}
|
||||
state: delete
|
||||
wait_for_resource: true
|
||||
when: is_bootstrap_node
|
||||
- name: Disable rabbitmq service
|
||||
tags: step2
|
||||
service: name=rabbitmq-server enabled=no
|
||||
|
@ -3,9 +3,6 @@
|
||||
# ...deploy..-e docker.yaml -e docker-ha.yaml
|
||||
resource_registry:
|
||||
# Pacemaker runs on the host
|
||||
OS::TripleO::Tasks::ControllerPreConfig: ../extraconfig/tasks/pre_puppet_pacemaker.yaml
|
||||
OS::TripleO::Tasks::ControllerPostConfig: ../extraconfig/tasks/post_puppet_pacemaker.yaml
|
||||
OS::TripleO::Tasks::ControllerPostPuppetRestart: ../extraconfig/tasks/post_puppet_pacemaker_restart.yaml
|
||||
OS::TripleO::Services::Pacemaker: ../puppet/services/pacemaker.yaml
|
||||
OS::TripleO::Services::PacemakerRemote: ../puppet/services/pacemaker_remote.yaml
|
||||
|
||||
|
@ -105,11 +105,6 @@ parameters:
|
||||
description: Whether to deploy a LoadBalancer on the Controller
|
||||
type: boolean
|
||||
|
||||
PacemakerResources:
|
||||
type: comma_delimited_list
|
||||
description: List of resources managed by pacemaker
|
||||
default: ['rabbitmq', 'galera']
|
||||
|
||||
outputs:
|
||||
role_data:
|
||||
description: Role data for the Pacemaker role.
|
||||
@ -156,20 +151,8 @@ outputs:
|
||||
async: 30
|
||||
poll: 4
|
||||
- name: Stop pacemaker cluster
|
||||
tags: step2
|
||||
tags: step3
|
||||
pacemaker_cluster: state=offline
|
||||
- name: Start pacemaker cluster
|
||||
tags: step4
|
||||
pacemaker_cluster: state=online
|
||||
- name: Check pacemaker resource
|
||||
tags: step4
|
||||
pacemaker_is_active:
|
||||
resource: "{{ item }}"
|
||||
max_wait: 500
|
||||
with_items: {get_param: PacemakerResources}
|
||||
- name: Check pacemaker haproxy resource
|
||||
tags: step4
|
||||
pacemaker_is_active:
|
||||
resource: haproxy
|
||||
max_wait: 500
|
||||
when: {get_param: EnableLoadBalancer}
|
||||
|
Loading…
Reference in New Issue
Block a user