From 3cbaadd09c034629fb20e3c663ad64b3b468f77b Mon Sep 17 00:00:00 2001 From: Marios Andreou Date: Thu, 18 Oct 2018 07:20:45 +0000 Subject: [PATCH] Revert "Convert *tasks from bootstrap_nodeid to short_bootstrap_node_name" This reverts commit 52c1641e2c3ad5caeb70fc8a09f29eba6fe5b53d due to the related bug below Change-Id: I3f6d8adae1918d1d55fdecc09fed5e4b45ee46b9 Related-Bug: 1798525 --- docker/services/cinder-api.yaml | 5 ++++- docker/services/ironic-api.yaml | 5 ++++- docker/services/nova-api.yaml | 5 ++++- docker/services/pacemaker/cinder-backup.yaml | 6 +++++- docker/services/pacemaker/cinder-volume.yaml | 6 +++++- docker/services/pacemaker/database/mysql.yaml | 5 ++++- docker/services/pacemaker/database/redis.yaml | 5 ++++- docker/services/pacemaker/haproxy.yaml | 6 +++++- docker/services/pacemaker/manila-share.yaml | 6 +++++- docker/services/pacemaker/notify-rabbitmq.yaml | 5 ++++- docker/services/pacemaker/ovn-dbs.yaml | 10 ++++++++-- docker/services/pacemaker/rabbitmq.yaml | 5 ++++- docker/services/pacemaker/rpc-rabbitmq.yaml | 5 ++++- puppet/services/database/redis-base.yaml | 2 +- puppet/services/gnocchi-api.yaml | 6 +++++- puppet/services/haproxy-public-tls-inject.yaml | 6 +++++- puppet/services/nova-api.yaml | 6 +++++- 17 files changed, 76 insertions(+), 18 deletions(-) diff --git a/docker/services/cinder-api.yaml b/docker/services/cinder-api.yaml index 90656b6ecf..f84ce7821b 100644 --- a/docker/services/cinder-api.yaml +++ b/docker/services/cinder-api.yaml @@ -249,8 +249,11 @@ outputs: - when: step|int == 0 tags: common block: + - name: get bootstrap nodeid + command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid + register: bootstrap_node - name: set is_bootstrap_node fact - set_fact: is_bootstrap_node={{cinder_api_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Check is cinder_api is deployed command: systemctl is-enabled openstack-cinder-api ignore_errors: True diff --git a/docker/services/ironic-api.yaml b/docker/services/ironic-api.yaml index b2e613f1db..7cf09a9d44 100644 --- a/docker/services/ironic-api.yaml +++ b/docker/services/ironic-api.yaml @@ -174,8 +174,11 @@ outputs: - when: step|int == 0 tags: common block: + - name: get bootstrap nodeid + command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid + register: bootstrap_node - name: set is_bootstrap_node fact - set_fact: is_bootstrap_node={{ironic_api_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Check if ironic_api is deployed command: systemctl is-enabled --quiet openstack-ironic-api ignore_errors: True diff --git a/docker/services/nova-api.yaml b/docker/services/nova-api.yaml index 104d862e33..84abc41a09 100644 --- a/docker/services/nova-api.yaml +++ b/docker/services/nova-api.yaml @@ -335,8 +335,11 @@ outputs: - when: step|int == 0 tags: common block: + - name: get bootstrap nodeid + command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid + register: bootstrap_node - name: set is_bootstrap_node fact - set_fact: is_bootstrap_node={{nova_api_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Check if nova_api is deployed command: systemctl is-enabled --quiet openstack-nova-api ignore_errors: True diff --git a/docker/services/pacemaker/cinder-backup.yaml b/docker/services/pacemaker/cinder-backup.yaml index d5a12a1137..da38de0fa7 100644 --- a/docker/services/pacemaker/cinder-backup.yaml +++ b/docker/services/pacemaker/cinder-backup.yaml @@ -329,9 +329,13 @@ outputs: - step|int == 1 - not cinder_backup_containerized|bool block: + - 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={{cinder_backup_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Check cluster resource status pacemaker_resource: resource: openstack-cinder-backup diff --git a/docker/services/pacemaker/cinder-volume.yaml b/docker/services/pacemaker/cinder-volume.yaml index a472d7624c..a0cea18120 100644 --- a/docker/services/pacemaker/cinder-volume.yaml +++ b/docker/services/pacemaker/cinder-volume.yaml @@ -354,9 +354,13 @@ outputs: - step|int == 1 - not cinder_volume_containerized|bool block: + - 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={{cinder_volume_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Check cluster resource status pacemaker_resource: resource: openstack-cinder-volume diff --git a/docker/services/pacemaker/database/mysql.yaml b/docker/services/pacemaker/database/mysql.yaml index d8ba91c875..20c3a618a7 100644 --- a/docker/services/pacemaker/database/mysql.yaml +++ b/docker/services/pacemaker/database/mysql.yaml @@ -363,8 +363,11 @@ outputs: - name: Check if Mysql is already containerized set_fact: mysql_containerized: "{{mysql_kolla_config.stat.isdir | default(false)}}" + - name: get bootstrap nodeid + command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid + register: bootstrap_node - name: set is_bootstrap_node fact - set_fact: is_bootstrap_node={{mysql_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Prepare the switch to new galera container image name in pacemaker when: mysql_containerized|bool block: diff --git a/docker/services/pacemaker/database/redis.yaml b/docker/services/pacemaker/database/redis.yaml index 0339990dc2..c06439ceeb 100644 --- a/docker/services/pacemaker/database/redis.yaml +++ b/docker/services/pacemaker/database/redis.yaml @@ -343,8 +343,11 @@ outputs: - name: Check if redis is already containerized set_fact: redis_containerized: "{{redis_kolla_config.stat.isdir | default(false)}}" + - name: get bootstrap nodeid + command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid + register: bootstrap_node - name: set is_bootstrap_node fact - set_fact: is_bootstrap_node={{redis_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Prepare the switch to new redis container image name in pacemaker when: redis_containerized|bool block: diff --git a/docker/services/pacemaker/haproxy.yaml b/docker/services/pacemaker/haproxy.yaml index 8f6d28cc5d..649b35c0a6 100644 --- a/docker/services/pacemaker/haproxy.yaml +++ b/docker/services/pacemaker/haproxy.yaml @@ -316,9 +316,13 @@ outputs: - name: Check if haproxy is already containerized set_fact: haproxy_containerized: "{{haproxy_kolla_config.stat.isdir | default(false)}}" + - 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={{haproxy_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Mount TLS cert if needed when: - step|int == 1 diff --git a/docker/services/pacemaker/manila-share.yaml b/docker/services/pacemaker/manila-share.yaml index e06b4e34cf..829071434d 100644 --- a/docker/services/pacemaker/manila-share.yaml +++ b/docker/services/pacemaker/manila-share.yaml @@ -296,9 +296,13 @@ outputs: - step|int == 1 - not manila_share_containerized|bool block: + - 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={{manila_share_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Check cluster resource status pacemaker_resource: resource: openstack-manila-share diff --git a/docker/services/pacemaker/notify-rabbitmq.yaml b/docker/services/pacemaker/notify-rabbitmq.yaml index 24a2f5982c..4efd53f972 100644 --- a/docker/services/pacemaker/notify-rabbitmq.yaml +++ b/docker/services/pacemaker/notify-rabbitmq.yaml @@ -312,8 +312,11 @@ outputs: - name: Check if Rabbitmq is already containerized set_fact: rabbit_containerized: "{{rabbit_kolla_config.stat.isdir | default(false)}}" + - name: get bootstrap nodeid + command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid + register: bootstrap_node - name: set is_bootstrap_node fact - set_fact: is_bootstrap_node={{notify_rabbitmq_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Rabbitmq baremetal to container upgrade tasks when: - step|int == 1 diff --git a/docker/services/pacemaker/ovn-dbs.yaml b/docker/services/pacemaker/ovn-dbs.yaml index 088e384948..daaeb9d93a 100644 --- a/docker/services/pacemaker/ovn-dbs.yaml +++ b/docker/services/pacemaker/ovn-dbs.yaml @@ -222,8 +222,11 @@ outputs: - name: Check if ovn-dbs is already containerized set_fact: ovn_dbs_containerized: "{{ovn_dbs_log_file.stat.exists | default(false)}}" + - name: get bootstrap nodeid + command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid + register: bootstrap_node - name: set is_bootstrap_node fact - set_fact: is_bootstrap_node={{ovn_dbs_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: ovn-dbs fetch and retag container image for pacemaker when: - step|int == 3 @@ -285,8 +288,11 @@ outputs: set_fact: ovn_dbs_docker_image: {get_param: DockerOvnDbsImage} ovn_dbs_docker_image_latest: *ovn_dbs_image_pcmklatest + - name: get bootstrap nodeid + command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid + register: bootstrap_node - name: set is_bootstrap_node fact - set_fact: is_bootstrap_node={{ovn_dbs_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Prepare the switch to new ovn-dbs container image name in pacemaker when: - step|int == 0 diff --git a/docker/services/pacemaker/rabbitmq.yaml b/docker/services/pacemaker/rabbitmq.yaml index 2c62f6540d..f8a1997628 100644 --- a/docker/services/pacemaker/rabbitmq.yaml +++ b/docker/services/pacemaker/rabbitmq.yaml @@ -308,8 +308,11 @@ outputs: - name: Check if Rabbitmq is already containerized set_fact: rabbit_containerized: "{{rabbit_kolla_config.stat.isdir | default(false)}}" + - name: get bootstrap nodeid + command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid + register: bootstrap_node - name: set is_bootstrap_node fact - set_fact: is_bootstrap_node={{rabbitmq_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Rabbitmq baremetal to container upgrade tasks when: - step|int == 1 diff --git a/docker/services/pacemaker/rpc-rabbitmq.yaml b/docker/services/pacemaker/rpc-rabbitmq.yaml index d4f24a7a70..b2b3310ce0 100644 --- a/docker/services/pacemaker/rpc-rabbitmq.yaml +++ b/docker/services/pacemaker/rpc-rabbitmq.yaml @@ -309,8 +309,11 @@ outputs: - name: Check if Rabbitmq is already containerized set_fact: rabbit_containerized: "{{rabbit_kolla_config.stat.isdir | default(false)}}" + - name: get bootstrap nodeid + command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid + register: bootstrap_node - name: set is_bootstrap_node fact - set_fact: is_bootstrap_node={{rpc_rabbitmq_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Rabbitmq baremetal to container upgrade tasks when: - step|int == 1 diff --git a/puppet/services/database/redis-base.yaml b/puppet/services/database/redis-base.yaml index ffc1c0ad82..bdea9dad9b 100644 --- a/puppet/services/database/redis-base.yaml +++ b/puppet/services/database/redis-base.yaml @@ -80,7 +80,7 @@ outputs: params: $NETWORK: {get_param: [ServiceNetMap, RedisNetwork]} redis::port: 6379 - redis::sentinel::master_name: "%{hiera('redis_short_bootstrap_node_name')}" + redis::sentinel::master_name: "%{hiera('bootstrap_nodeid')}" redis::sentinel::redis_host: "%{hiera('bootstrap_nodeid_ip')}" redis::sentinel::notification_script: '/usr/local/bin/redis-notifications.sh' redis::sentinel::sentinel_bind: diff --git a/puppet/services/gnocchi-api.yaml b/puppet/services/gnocchi-api.yaml index 5eaff5344d..b0f6c6dc11 100644 --- a/puppet/services/gnocchi-api.yaml +++ b/puppet/services/gnocchi-api.yaml @@ -188,9 +188,13 @@ outputs: - name: Stop gnocchi_api service (running under httpd) when: step|int == 1 service: name=httpd state=stopped + - name: get bootstrap nodeid + tags: common + command: hiera bootstrap_nodeid + register: bootstrap_node - name: set is_bootstrap_node fact tags: common - set_fact: is_bootstrap_node={{gnocchi_api_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Setup gnocchi db during upgrade command: gnocchi-upgrade when: diff --git a/puppet/services/haproxy-public-tls-inject.yaml b/puppet/services/haproxy-public-tls-inject.yaml index ddc7cb3f19..5cd9fb2a31 100644 --- a/puppet/services/haproxy-public-tls-inject.yaml +++ b/puppet/services/haproxy-public-tls-inject.yaml @@ -84,8 +84,12 @@ outputs: stat: path: "{{cert_path}}" + - name: Assign bootstrap node + command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid + register: bootstrap_node + - name: set is_bootstrap_node fact - set_fact: is_bootstrap_node={{haproxy_public_tls_inject_short_bootstrap_node_name == ansible_hostname}} + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: get haproxy status register: haproxy_state diff --git a/puppet/services/nova-api.yaml b/puppet/services/nova-api.yaml index 86200ebc95..add5f032db 100644 --- a/puppet/services/nova-api.yaml +++ b/puppet/services/nova-api.yaml @@ -249,9 +249,13 @@ outputs: list_concat: - get_attr: [ApacheServiceBase, role_data, upgrade_tasks] - + - name: get bootstrap nodeid + tags: common + command: hiera bootstrap_nodeid + register: bootstrap_node - name: set is_bootstrap_node fact tags: common - set_fact: is_bootstrap_node={{nova_api_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Extra migration for nova tripleo/+bug/1656791 tags: pre-upgrade when: