tripleo-heat-templates/container_config_scripts
Damien Ciabrini fb88ed98a2 Check whether an HA resource already exists explicitly
With ephemeral heat we lost the meaning of the 'stack_action' hiera key
which we previously used to distinguish between fresh deployment and
pre-existing deployment (aka redeploy).
Since this hiera key is not available anymore, in ansible we added a
TRIPLEO_HA_WRAPPER_RESOURCE_EXISTS env variable which will be true
when the resource existed even before calling puppet.

This way we can restore the previous behaviour (which was relying
on the stack_update hiera key) of restarting an HA
bundle on the bootstrap node in case of a configuration change.

While we're at it we make sure that the logging takes place via logger
so we're sure to capture these events in the journal.

Tested as follows:
1) Initial deploy:
[root@controller-0 ~]# journalctl |grep pcmkres
Sep 01 10:23:35 controller-0.alejandro.ftw pcmkrestart[47636]: Initial deployment, skipping the restart of haproxy-bundle
Sep 01 10:24:25 controller-0.alejandro.ftw pcmkrestart[49735]: Initial deployment, skipping the restart of galera-bundle
Sep 01 10:25:15 controller-0.alejandro.ftw pcmkrestart[53052]: Initial deployment, skipping the restart of rabbitmq-bundle
Sep 01 10:37:35 controller-0.alejandro.ftw pcmkrestart[148651]: Initial deployment, skipping the restart of openstack-cinder-volume

Redeploy changing only the haproxy config via a hiera key change:
Sep 01 11:12:29 controller-0.alejandro.ftw pcmkrestart[438507]: Wed Sep Restarting haproxy-bundle globally. Stopping:
Sep 01 11:12:37 controller-0.alejandro.ftw pcmkrestart[439271]: Wed Sep Restarting haproxy-bundle globally. Starting:

Depends-On: https://review.opendev.org/c/openstack/tripleo-ansible/+/836134

Closes-Bug: #1942309

Change-Id: I90ea2287b5ab32c8dc6bbf5f91927e7488326dcd
(cherry picked from commit ad2a13ab47)
(cherry picked from commit 79791ce30d)
2022-04-01 13:51:36 +02:00
..
monitoring Return details in output of container health check 2020-10-14 11:57:56 +02:00
tests Skip Trilio dirs when setting ownership in /var/lib/nova 2020-12-21 11:49:16 +01:00
__init__.py Rename docker_config_scripts to container_config_scripts 2019-03-06 09:05:50 -05:00
mysql_upgrade_db.sh Upgrade mariadb storage during upgrade tasks 2021-03-01 13:19:24 +00:00
nova_statedir_ownership.py Skip Trilio dirs when setting ownership in /var/lib/nova 2020-12-21 11:49:16 +01:00
nova_wait_for_api_service.py Change optparse to argparse 2020-01-21 04:17:09 +00:00
nova_wait_for_compute_service.py Change optparse to argparse 2020-01-21 04:17:09 +00:00
pacemaker_mutex_restart_bundle.sh Rolling certificate update for HA services 2020-07-30 16:51:48 +02:00
pacemaker_mutex_shutdown.sh Serialize shutdown of pacemaker nodes 2021-01-21 13:15:12 +00:00
pacemaker_resource_lock.sh Serialize shutdown of pacemaker nodes 2021-01-21 13:15:12 +00:00
pacemaker_restart_bundle.sh Check whether an HA resource already exists explicitly 2022-04-01 13:51:36 +02:00
pacemaker_wait_bundle.sh HA: reorder init_bundle and restart_bundle for improved updates 2020-01-23 16:09:36 +01:00
placement_wait_for_service.py Stop to use the __future__ module. 2020-07-02 15:27:27 +00:00
pyshim.sh Fix typos 2020-09-16 15:45:12 +05:30
wait-port-and-run.sh Ensure redis_tls_proxy starts after all redis instances 2020-07-07 05:36:43 +00:00