Browse Source

Convert *tasks from bootstrap_nodeid to short_bootstrap_node_name

The current approach has several disadvantages:
- Requires shelling out to the hiera CLI, and is coupled to the puppet hieradata
- The bootstrap_nodeid is only unique per Role, not per service, so if you
  deploy a service spanning more than one role it will evaluate true for
  every role, not only once.

Instead lets use the per-service short_bootstrap_node_name, which is
available directly via the ansible inventory now ref
https://review.openstack.org/#/c/605046/

This is the first part of a cleanup for inconsistent handling of
bootstrap node evaluation, triggered by bug #1792613

Change-Id: Iefe4a37e8ced6f4e9018ae0da00e2349390d4927
Partial-Bug: #1792613
Depends-On: Idcee177b21e85cff9e0bf10f4c43c71eff9364ec
changes/30/605430/5
Steven Hardy 3 years ago
parent
commit
52c1641e2c
  1. 5
      docker/services/cinder-api.yaml
  2. 5
      docker/services/ironic-api.yaml
  3. 5
      docker/services/nova-api.yaml
  4. 6
      docker/services/pacemaker/cinder-backup.yaml
  5. 6
      docker/services/pacemaker/cinder-volume.yaml
  6. 5
      docker/services/pacemaker/database/mysql.yaml
  7. 5
      docker/services/pacemaker/database/redis.yaml
  8. 6
      docker/services/pacemaker/haproxy.yaml
  9. 6
      docker/services/pacemaker/manila-share.yaml
  10. 5
      docker/services/pacemaker/notify-rabbitmq.yaml
  11. 10
      docker/services/pacemaker/ovn-dbs.yaml
  12. 5
      docker/services/pacemaker/rabbitmq.yaml
  13. 5
      docker/services/pacemaker/rpc-rabbitmq.yaml
  14. 2
      puppet/services/database/redis-base.yaml
  15. 6
      puppet/services/gnocchi-api.yaml
  16. 6
      puppet/services/haproxy-public-tls-inject.yaml
  17. 6
      puppet/services/nova-api.yaml

5
docker/services/cinder-api.yaml

@ -249,11 +249,8 @@ 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={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
set_fact: is_bootstrap_node={{cinder_api_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Check is cinder_api is deployed
command: systemctl is-enabled openstack-cinder-api
ignore_errors: True

5
docker/services/ironic-api.yaml

@ -174,11 +174,8 @@ 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={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
set_fact: is_bootstrap_node={{ironic_api_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Check if ironic_api is deployed
command: systemctl is-enabled --quiet openstack-ironic-api
ignore_errors: True

5
docker/services/nova-api.yaml

@ -335,11 +335,8 @@ 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={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
set_fact: is_bootstrap_node={{nova_api_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Check if nova_api is deployed
command: systemctl is-enabled --quiet openstack-nova-api
ignore_errors: True

6
docker/services/pacemaker/cinder-backup.yaml

@ -329,13 +329,9 @@ 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={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
set_fact: is_bootstrap_node={{cinder_backup_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Check cluster resource status
pacemaker_resource:
resource: openstack-cinder-backup

6
docker/services/pacemaker/cinder-volume.yaml

@ -354,13 +354,9 @@ 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={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
set_fact: is_bootstrap_node={{cinder_volume_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Check cluster resource status
pacemaker_resource:
resource: openstack-cinder-volume

5
docker/services/pacemaker/database/mysql.yaml

@ -363,11 +363,8 @@ 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={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
set_fact: is_bootstrap_node={{mysql_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Prepare the switch to new galera container image name in pacemaker
when: mysql_containerized|bool
block:

5
docker/services/pacemaker/database/redis.yaml

@ -343,11 +343,8 @@ 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={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
set_fact: is_bootstrap_node={{redis_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Prepare the switch to new redis container image name in pacemaker
when: redis_containerized|bool
block:

6
docker/services/pacemaker/haproxy.yaml

@ -316,13 +316,9 @@ 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={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
set_fact: is_bootstrap_node={{haproxy_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Mount TLS cert if needed
when:
- step|int == 1

6
docker/services/pacemaker/manila-share.yaml

@ -296,13 +296,9 @@ 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={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
set_fact: is_bootstrap_node={{manila_share_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Check cluster resource status
pacemaker_resource:
resource: openstack-manila-share

5
docker/services/pacemaker/notify-rabbitmq.yaml

@ -312,11 +312,8 @@ 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={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
set_fact: is_bootstrap_node={{notify_rabbitmq_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Rabbitmq baremetal to container upgrade tasks
when:
- step|int == 1

10
docker/services/pacemaker/ovn-dbs.yaml

@ -222,11 +222,8 @@ 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={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
set_fact: is_bootstrap_node={{ovn_dbs_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: ovn-dbs fetch and retag container image for pacemaker
when:
- step|int == 3
@ -288,11 +285,8 @@ 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={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
set_fact: is_bootstrap_node={{ovn_dbs_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Prepare the switch to new ovn-dbs container image name in pacemaker
when:
- step|int == 0

5
docker/services/pacemaker/rabbitmq.yaml

@ -308,11 +308,8 @@ 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={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
set_fact: is_bootstrap_node={{rabbitmq_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Rabbitmq baremetal to container upgrade tasks
when:
- step|int == 1

5
docker/services/pacemaker/rpc-rabbitmq.yaml

@ -309,11 +309,8 @@ 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={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
set_fact: is_bootstrap_node={{rpc_rabbitmq_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Rabbitmq baremetal to container upgrade tasks
when:
- step|int == 1

2
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('bootstrap_nodeid')}"
redis::sentinel::master_name: "%{hiera('redis_short_bootstrap_node_name')}"
redis::sentinel::redis_host: "%{hiera('bootstrap_nodeid_ip')}"
redis::sentinel::notification_script: '/usr/local/bin/redis-notifications.sh'
redis::sentinel::sentinel_bind:

6
puppet/services/gnocchi-api.yaml

@ -188,13 +188,9 @@ 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={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
set_fact: is_bootstrap_node={{gnocchi_api_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Setup gnocchi db during upgrade
command: gnocchi-upgrade
when:

6
puppet/services/haproxy-public-tls-inject.yaml

@ -84,12 +84,8 @@ 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={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
set_fact: is_bootstrap_node={{haproxy_public_tls_inject_short_bootstrap_node_name == ansible_hostname}}
- name: get haproxy status
register: haproxy_state

6
puppet/services/nova-api.yaml

@ -249,13 +249,9 @@ 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={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
set_fact: is_bootstrap_node={{nova_api_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Extra migration for nova tripleo/+bug/1656791
tags: pre-upgrade
when:

Loading…
Cancel
Save