From 1065da35a04579aeb384048b163187179b855d35 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Fri, 11 May 2018 12:12:32 +0200 Subject: [PATCH] rerun *_init_bundles all the time In the same spirit as change I1f07272499b419079466cf9f395fb04a082099bd we want to rerun all pacemaker _init_bundles all the time. For a few main reasons: 1) We will eventually support scaling-up roles that contain pacemaker-managed services and we need to rerun _init_bundles so that pacemaker properties are created for the newly added nodes. 2) When you replace a controller the pacemaker properties will be recreated for the newly added node. 3) We need to create appropriate iptables rules whenever we add a service to an existing deployment. We do this by adding the DeployIdentifier to the environment so that paunch will retrigger a run at every redeploy. Partial-Bug: #1775196 Change-Id: Ifd48d74507609fc7f4abc269b61b2868bfbc9272 (cherry picked from commit a0dfc6c0c694091eae195d4090a63e339f3daa39) --- docker/services/pacemaker/cinder-backup.yaml | 13 +++++++++++++ docker/services/pacemaker/cinder-volume.yaml | 13 +++++++++++++ docker/services/pacemaker/database/redis.yaml | 13 +++++++++++++ docker/services/pacemaker/haproxy.yaml | 13 +++++++++++++ docker/services/pacemaker/manila-share.yaml | 13 +++++++++++++ docker/services/pacemaker/ovn-dbs.yaml | 13 +++++++++++++ docker/services/pacemaker/rabbitmq.yaml | 13 +++++++++++++ 7 files changed, 91 insertions(+) diff --git a/docker/services/pacemaker/cinder-backup.yaml b/docker/services/pacemaker/cinder-backup.yaml index b0cfd792f0..0b9f69970f 100644 --- a/docker/services/pacemaker/cinder-backup.yaml +++ b/docker/services/pacemaker/cinder-backup.yaml @@ -57,6 +57,12 @@ parameters: description: Time in seconds to wait for a pcmk resource to restart when a config change is detected and the resource is being restarted type: number + DeployIdentifier: + default: '' + type: string + description: > + Setting this to a unique value will re-run any deployment tasks which + perform configuration on a Heat stack-update. conditions: puppet_debug_enabled: {get_param: ConfigDebug} @@ -218,6 +224,13 @@ outputs: - {get_attr: [ContainersCommon, docker_puppet_apply_volumes]} - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - /dev/shm:/dev/shm:rw + environment: + # NOTE: this should force this container to re-run on each + # update (scale-out, etc.) + - list_join: + - '' + - - 'TRIPLEO_DEPLOY_IDENTIFIER=' + - {get_param: DeployIdentifier} host_prep_tasks: - name: create persistent directories file: diff --git a/docker/services/pacemaker/cinder-volume.yaml b/docker/services/pacemaker/cinder-volume.yaml index 1c46f87f6f..8bbe248c42 100644 --- a/docker/services/pacemaker/cinder-volume.yaml +++ b/docker/services/pacemaker/cinder-volume.yaml @@ -54,6 +54,12 @@ parameters: description: Time in seconds to wait for a pcmk resource to restart when a config change is detected and the resource is being restarted type: number + DeployIdentifier: + default: '' + type: string + description: > + Setting this to a unique value will re-run any deployment tasks which + perform configuration on a Heat stack-update. conditions: puppet_debug_enabled: {get_param: ConfigDebug} @@ -212,6 +218,13 @@ outputs: - {get_attr: [ContainersCommon, docker_puppet_apply_volumes]} - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - /dev/shm:/dev/shm:rw + environment: + # NOTE: this should force this container to re-run on each + # update (scale-out, etc.) + - list_join: + - '' + - - 'TRIPLEO_DEPLOY_IDENTIFIER=' + - {get_param: DeployIdentifier} host_prep_tasks: - name: create persistent directories file: diff --git a/docker/services/pacemaker/database/redis.yaml b/docker/services/pacemaker/database/redis.yaml index bf0dd1941c..81798a1acd 100644 --- a/docker/services/pacemaker/database/redis.yaml +++ b/docker/services/pacemaker/database/redis.yaml @@ -52,6 +52,12 @@ parameters: description: Time in seconds to wait for a pcmk resource to restart when a config change is detected and the resource is being restarted type: number + DeployIdentifier: + default: '' + type: string + description: > + Setting this to a unique value will re-run any deployment tasks which + perform configuration on a Heat stack-update. conditions: puppet_debug_enabled: {get_param: ConfigDebug} @@ -246,6 +252,13 @@ outputs: - {get_attr: [ContainersCommon, docker_puppet_apply_volumes]} - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - /dev/shm:/dev/shm:rw + environment: + # NOTE: this should force this container to re-run on each + # update (scale-out, etc.) + - list_join: + - '' + - - 'TRIPLEO_DEPLOY_IDENTIFIER=' + - {get_param: DeployIdentifier} - if: - internal_tls_enabled - redis_tls_proxy: diff --git a/docker/services/pacemaker/haproxy.yaml b/docker/services/pacemaker/haproxy.yaml index 3d1492b9b5..ecc6570cf4 100644 --- a/docker/services/pacemaker/haproxy.yaml +++ b/docker/services/pacemaker/haproxy.yaml @@ -76,6 +76,12 @@ parameters: description: Time in seconds to wait for a pcmk resource to restart when a config change is detected and the resource is being restarted type: number + DeployIdentifier: + default: '' + type: string + description: > + Setting this to a unique value will re-run any deployment tasks which + perform configuration on a Heat stack-update. conditions: puppet_debug_enabled: {get_param: ConfigDebug} @@ -265,6 +271,13 @@ outputs: - /usr/libexec/initscripts/legacy-actions:/usr/libexec/initscripts/legacy-actions:ro - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - /dev/shm:/dev/shm:rw + environment: + # NOTE: this should force this container to re-run on each + # update (scale-out, etc.) + - list_join: + - '' + - - 'TRIPLEO_DEPLOY_IDENTIFIER=' + - {get_param: DeployIdentifier} host_prep_tasks: - name: create persistent directories file: diff --git a/docker/services/pacemaker/manila-share.yaml b/docker/services/pacemaker/manila-share.yaml index fcc2d5a71d..34271a9cb1 100644 --- a/docker/services/pacemaker/manila-share.yaml +++ b/docker/services/pacemaker/manila-share.yaml @@ -45,6 +45,12 @@ parameters: description: Time in seconds to wait for a pcmk resource to restart when a config change is detected and the resource is being restarted type: number + DeployIdentifier: + default: '' + type: string + description: > + Setting this to a unique value will re-run any deployment tasks which + perform configuration on a Heat stack-update. conditions: puppet_debug_enabled: {get_param: ConfigDebug} @@ -188,6 +194,13 @@ outputs: - {get_attr: [ContainersCommon, docker_puppet_apply_volumes]} - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - /dev/shm:/dev/shm:rw + environment: + # NOTE: this should force this container to re-run on each + # update (scale-out, etc.) + - list_join: + - '' + - - 'TRIPLEO_DEPLOY_IDENTIFIER=' + - {get_param: DeployIdentifier} host_prep_tasks: - name: create persistent directories file: diff --git a/docker/services/pacemaker/ovn-dbs.yaml b/docker/services/pacemaker/ovn-dbs.yaml index 1b7717b4f0..90c92c1494 100644 --- a/docker/services/pacemaker/ovn-dbs.yaml +++ b/docker/services/pacemaker/ovn-dbs.yaml @@ -53,6 +53,12 @@ parameters: description: Time in seconds to wait for a pcmk resource to restart when a config change is detected and the resource is being restarted type: number + DeployIdentifier: + default: '' + type: string + description: > + Setting this to a unique value will re-run any deployment tasks which + perform configuration on a Heat stack-update. conditions: puppet_debug_enabled: {get_param: ConfigDebug} @@ -154,6 +160,13 @@ outputs: - {get_attr: [ContainersCommon, docker_puppet_apply_volumes]} - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - /dev/shm:/dev/shm:rw + environment: + # NOTE: this should force this container to re-run on each + # update (scale-out, etc.) + - list_join: + - '' + - - 'TRIPLEO_DEPLOY_IDENTIFIER=' + - {get_param: DeployIdentifier} host_prep_tasks: - name: create persistent directories file: diff --git a/docker/services/pacemaker/rabbitmq.yaml b/docker/services/pacemaker/rabbitmq.yaml index b384a95692..7451b9b4e7 100644 --- a/docker/services/pacemaker/rabbitmq.yaml +++ b/docker/services/pacemaker/rabbitmq.yaml @@ -49,6 +49,12 @@ parameters: description: Time in seconds to wait for a pcmk resource to restart when a config change is detected and the resource is being restarted type: number + DeployIdentifier: + default: '' + type: string + description: > + Setting this to a unique value will re-run any deployment tasks which + perform configuration on a Heat stack-update. conditions: puppet_debug_enabled: {get_param: ConfigDebug} @@ -234,6 +240,13 @@ outputs: - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - /dev/shm:/dev/shm:rw - /bin/true:/bin/epmd + environment: + # NOTE: this should force this container to re-run on each + # update (scale-out, etc.) + - list_join: + - '' + - - 'TRIPLEO_DEPLOY_IDENTIFIER=' + - {get_param: DeployIdentifier} host_prep_tasks: - name: create persistent directories file: