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:
Reviewed: https:/ /review. opendev. org/c/openstack /tripleo- heat-templates/ +/807861 /opendev. org/openstack/ tripleo- heat-templates/ commit/ 79791ce30d3203d 03e9a4db4b3c189 91d5102ff2
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/wallaby
commit 79791ce30d3203d 03e9a4db4b3c189 91d5102ff2
Author: Damien Ciabrini <email address hidden>
Date: Mon Aug 30 17:17:46 2021 +0200
Check whether an HA resource already exists explicitly
With ephemeral heat we lost the meaning of the 'stack_action' hiera key HA_WRAPPER_ RESOURCE_ EXISTS env variable which will be true
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_
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: controller- 0 ~]# journalctl |grep pcmkres 0.alejandro. ftw pcmkrestart[47636]: Initial deployment, skipping the restart of haproxy-bundle 0.alejandro. ftw pcmkrestart[49735]: Initial deployment, skipping the restart of galera-bundle 0.alejandro. ftw pcmkrestart[53052]: Initial deployment, skipping the restart of rabbitmq-bundle 0.alejandro. ftw pcmkrestart[ 148651] : Initial deployment, skipping the restart of openstack- cinder- volume
1) Initial deploy:
[root@
Sep 01 10:23:35 controller-
Sep 01 10:24:25 controller-
Sep 01 10:25:15 controller-
Sep 01 10:37:35 controller-
Redeploy changing only the haproxy config via a hiera key change: 0.alejandro. ftw pcmkrestart[ 438507] : Wed Sep Restarting haproxy-bundle globally. Stopping: 0.alejandro. ftw pcmkrestart[ 439271] : Wed Sep Restarting haproxy-bundle globally. Starting:
Sep 01 11:12:29 controller-
Sep 01 11:12:37 controller-
Depends-On: https:/ /review. opendev. org/c/openstack /tripleo- ansible/ +/807761
Closes-Bug: #1942309
Change-Id: I90ea2287b5ab32 c8dc6bbf5f91927 e7488326dcd c948d8c229dde8b 9f1386ea29)
(cherry picked from commit ad2a13ab47b6ad6