From a0dfc6c0c694091eae195d4090a63e339f3daa39 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 --- 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/notify-rabbitmq.yaml | 13 +++++++++++++ docker/services/pacemaker/ovn-dbs.yaml | 13 +++++++++++++ docker/services/pacemaker/rabbitmq.yaml | 13 +++++++++++++ docker/services/pacemaker/rpc-rabbitmq.yaml | 13 +++++++++++++ 9 files changed, 117 insertions(+) diff --git a/docker/services/pacemaker/cinder-backup.yaml b/docker/services/pacemaker/cinder-backup.yaml index 28c0f5c74b..2cff07d2f0 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 e141e3cd9b..5109b1ffdd 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 c4516beb3a..cd13529a87 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} @@ -250,6 +256,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 21826a4a54..69f0f684cc 100644 --- a/docker/services/pacemaker/haproxy.yaml +++ b/docker/services/pacemaker/haproxy.yaml @@ -81,6 +81,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} @@ -272,6 +278,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: - {get_attr: [HAProxyBase, role_data, host_prep_tasks]} - name: create persistent directories diff --git a/docker/services/pacemaker/manila-share.yaml b/docker/services/pacemaker/manila-share.yaml index ff498444eb..cdc28dac25 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/notify-rabbitmq.yaml b/docker/services/pacemaker/notify-rabbitmq.yaml index 9420f866bc..d9c40f90f7 100644 --- a/docker/services/pacemaker/notify-rabbitmq.yaml +++ b/docker/services/pacemaker/notify-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} @@ -235,6 +241,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: diff --git a/docker/services/pacemaker/ovn-dbs.yaml b/docker/services/pacemaker/ovn-dbs.yaml index 0c5de0cd34..0b50291920 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 02902bafa6..d90fd50556 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: diff --git a/docker/services/pacemaker/rpc-rabbitmq.yaml b/docker/services/pacemaker/rpc-rabbitmq.yaml index 9900e6d404..427753960d 100644 --- a/docker/services/pacemaker/rpc-rabbitmq.yaml +++ b/docker/services/pacemaker/rpc-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} @@ -235,6 +241,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} metadata_settings: get_attr: [RabbitmqBase, role_data, metadata_settings] host_prep_tasks: