From 29bc3de01dc39bb02eb7e7c27cc3661c591143bb Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Fri, 1 May 2020 13:42:26 +0200 Subject: [PATCH] pcs commands on host: rabbitmq This implements the creation of the rabbitmq bundle on the host. The testing protocol used is documented in the depends-on. The reason for adding a post_update task is that during a minor update the deployment tasks are not run during the node update procedure but only during the final converge. So we ran the role again there to make sure that any config change will trigger a restart during the minor update, so the disruption is only local to the single node being updated. If we did not do this a final converge could potentially trigger a global restart of HA bundles which would be quite disruptive. NB: The init_bundle now has become the wait_bundle as it just waits for rabbitmq to be up and functional Related-Bug; #1863442 Depends-On: Iaa7e89f0d25221c2a6ef0b81eb88a6f496f01696 Change-Id: I853bcf354f64ef88cec9e68ad5c123e4af786de3 --- ...tmq-messaging-notify-pacemaker-puppet.yaml | 49 ++++++++++--------- .../rabbitmq-messaging-pacemaker-puppet.yaml | 49 ++++++++++--------- ...bbitmq-messaging-rpc-pacemaker-puppet.yaml | 49 ++++++++++--------- 3 files changed, 78 insertions(+), 69 deletions(-) diff --git a/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml b/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml index f2edcdce46..015bc9c24e 100644 --- a/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml +++ b/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml @@ -195,7 +195,7 @@ outputs: - {get_param: RabbitCookie} - {get_param: [DefaultPasswords, rabbit_cookie]} step_2: - rabbitmq_init_bundle: + rabbitmq_wait_bundle: start_order: 0 detach: false net: host @@ -205,8 +205,8 @@ outputs: list_concat: - - '/container_puppet_apply.sh' - '2' - - 'file,file_line,concat,augeas,pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation,rabbitmq_policy,rabbitmq_user,rabbitmq_ready' - - 'include tripleo::profile::base::pacemaker;include tripleo::profile::pacemaker::rabbitmq_bundle' + - 'file,file_line,concat,augeas,rabbitmq_policy,rabbitmq_user,rabbitmq_ready' + - 'include tripleo::profile::pacemaker::rabbitmq_bundle' - if: - puppet_debug_enabled - - '--debug' @@ -216,10 +216,6 @@ outputs: list_concat: - {get_attr: [ContainersCommon, container_puppet_apply_volumes]} - - /bin/true:/bin/epmd - - if: - - docker_enabled - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - - null environment: # https://launchpad.net/bugs/1822673 (lang/lc_all to utf-8 are an elixir requirement) LANG: 'en_US.UTF-8' @@ -227,21 +223,6 @@ outputs: # NOTE: this should force this container to re-run on each # update (scale-out, etc.) TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier} - rabbitmq_restart_bundle: - start_order: 5 - config_volume: rabbitmq - detach: false - net: host - ipc: host - user: root - environment: - TRIPLEO_MINOR_UPDATE: '' - command: /var/lib/container-config-scripts/pacemaker_restart_bundle.sh oslo_messaging_notify rabbitmq rabbitmq-bundle Started - image: {get_param: ContainerRabbitmqImage} - volumes: - list_concat: - - {get_attr: [ContainersCommon, pacemaker_restart_volumes]} - - - /var/lib/config-data/puppet-generated/rabbitmq:/var/lib/kolla/config_files/src:ro host_prep_tasks: - name: create persistent directories file: @@ -267,6 +248,21 @@ outputs: vars: container_image: {get_param: ContainerRabbitmqImage} container_image_latest: *rabbitmq_image_pcmklatest + - name: RabbitMQ Notify HA Wrappers Step + when: step|int == 2 + block: &oslo_messaging_notify_puppet_bundle + - name: RabbitMQ notify puppet bundle + import_role: + name: tripleo_ha_wrapper + vars: + tripleo_ha_wrapper_service_name: oslo_messaging_notify + tripleo_ha_wrapper_resource_name: rabbitmq + tripleo_ha_wrapper_bundle_name: rabbitmq-bundle + tripleo_ha_wrapper_resource_state: Started + tripleo_ha_wrapper_puppet_config_volume: rabbitmq + tripleo_ha_wrapper_puppet_execute: 'include ::tripleo::profile::base::pacemaker; include ::tripleo::profile::pacemaker::rabbitmq_bundle' + tripleo_ha_wrapper_puppet_tags: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ip,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation' + tripleo_ha_wrapper_puppet_debug: {get_param: ConfigDebug} update_tasks: - name: Tear-down non-HA rabbitmq container @@ -305,6 +301,13 @@ outputs: when: - old_rabbitmq_image_id.stdout != new_rabbitmq_image_id.stdout + post_update_tasks: + - name: Rabbitmq notify bundle post update + when: step|int == 1 + block: *oslo_messaging_notify_puppet_bundle + vars: + tripleo_ha_wrapper_minor_update: true + upgrade_tasks: - name: Tear-down non-HA rabbitmq container when: @@ -415,7 +418,7 @@ outputs: name: tripleo_container_rm vars: tripleo_containers_to_rm: - - rabbitmq_init_bundle + - rabbitmq_wait_bundle when: - oslo_messaging_notify_short_node_names_upgraded | length > 1 - name: add the oslo_messaging_notify short name to hiera data for the upgrade. diff --git a/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml b/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml index a03641e63d..2433d44594 100644 --- a/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml +++ b/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml @@ -195,7 +195,7 @@ outputs: - {get_param: RabbitCookie} - {get_param: [DefaultPasswords, rabbit_cookie]} step_2: - rabbitmq_init_bundle: + rabbitmq_wait_bundle: start_order: 0 detach: false net: host @@ -205,8 +205,8 @@ outputs: list_concat: - - '/container_puppet_apply.sh' - '2' - - 'file,file_line,concat,augeas,pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation,rabbitmq_policy,rabbitmq_user,rabbitmq_ready' - - 'include tripleo::profile::base::pacemaker;include tripleo::profile::pacemaker::rabbitmq_bundle' + - 'file,file_line,concat,augeas,rabbitmq_policy,rabbitmq_user,rabbitmq_ready' + - 'include tripleo::profile::pacemaker::rabbitmq_bundle' - if: - puppet_debug_enabled - - '--debug' @@ -216,10 +216,6 @@ outputs: list_concat: - {get_attr: [ContainersCommon, container_puppet_apply_volumes]} - - /bin/true:/bin/epmd - - if: - - docker_enabled - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - - null environment: # https://launchpad.net/bugs/1822673 (lang/lc_all to utf-8 are an elixir requirement) LANG: 'en_US.UTF-8' @@ -227,21 +223,6 @@ outputs: # NOTE: this should force this container to re-run on each # update (scale-out, etc.) TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier} - rabbitmq_restart_bundle: - start_order: 6 - config_volume: rabbitmq - detach: false - net: host - ipc: host - user: root - environment: - TRIPLEO_MINOR_UPDATE: '' - command: /var/lib/container-config-scripts/pacemaker_restart_bundle.sh rabbitmq rabbitmq rabbitmq-bundle Started - image: {get_param: ContainerRabbitmqImage} - volumes: - list_concat: - - {get_attr: [ContainersCommon, pacemaker_restart_volumes]} - - - /var/lib/config-data/puppet-generated/rabbitmq:/var/lib/kolla/config_files/src:ro host_prep_tasks: - name: create persistent directories file: @@ -267,6 +248,21 @@ outputs: vars: container_image: {get_param: ContainerRabbitmqImage} container_image_latest: *rabbitmq_image_pcmklatest + - name: RabbitMQ HA Wrappers Step + when: step|int == 2 + block: &rabbitmq_puppet_bundle + - name: Rabbitmq puppet bundle + import_role: + name: tripleo_ha_wrapper + vars: + tripleo_ha_wrapper_service_name: rabbitmq + tripleo_ha_wrapper_resource_name: rabbitmq + tripleo_ha_wrapper_bundle_name: rabbitmq-bundle + tripleo_ha_wrapper_resource_state: Started + tripleo_ha_wrapper_puppet_config_volume: rabbitmq + tripleo_ha_wrapper_puppet_execute: 'include ::tripleo::profile::base::pacemaker; include ::tripleo::profile::pacemaker::rabbitmq_bundle' + tripleo_ha_wrapper_puppet_tags: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ip,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation' + tripleo_ha_wrapper_puppet_debug: {get_param: ConfigDebug} update_tasks: - name: Tear-down non-HA rabbitmq container @@ -305,6 +301,13 @@ outputs: when: - old_rabbitmq_image_id.stdout != new_rabbitmq_image_id.stdout + post_update_tasks: + - name: Rabbitmq bundle post update + when: step|int == 1 + block: *rabbitmq_puppet_bundle + vars: + tripleo_ha_wrapper_minor_update: true + upgrade_tasks: - name: Tear-down non-HA rabbitmq container when: @@ -412,7 +415,7 @@ outputs: name: tripleo_container_rm vars: tripleo_containers_to_rm: - - rabbitmq_init_bundle + - rabbitmq_wait_bundle when: - rabbitmq_short_node_names_upgraded | length > 1 - name: add the rabbitmq short name to hiera data for the upgrade. diff --git a/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml b/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml index da7e6994e4..4f64f333e2 100644 --- a/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml +++ b/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml @@ -195,7 +195,7 @@ outputs: - {get_param: RabbitCookie} - {get_param: [DefaultPasswords, rabbit_cookie]} step_2: - rabbitmq_init_bundle: + rabbitmq_wait_bundle: start_order: 0 detach: false net: host @@ -205,8 +205,8 @@ outputs: list_concat: - - '/container_puppet_apply.sh' - '2' - - 'file,file_line,concat,augeas,pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation,rabbitmq_policy,rabbitmq_user,rabbitmq_ready' - - 'include tripleo::profile::base::pacemaker;include tripleo::profile::pacemaker::rabbitmq_bundle' + - 'file,file_line,concat,augeas,rabbitmq_policy,rabbitmq_user,rabbitmq_ready' + - 'include tripleo::profile::pacemaker::rabbitmq_bundle' - if: - puppet_debug_enabled - - '--debug' @@ -216,10 +216,6 @@ outputs: list_concat: - {get_attr: [ContainersCommon, container_puppet_apply_volumes]} - - /bin/true:/bin/epmd - - if: - - docker_enabled - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - - null environment: KOLLA_CONFIG_STRATEGY: COPY_ALWAYS KOLLA_BOOTSTRAP: true @@ -231,21 +227,6 @@ outputs: - rabbit_cookie_param_set - {get_param: RabbitCookie} - {get_param: [DefaultPasswords, rabbit_cookie]} - rabbitmq_restart_bundle: - start_order: 4 - config_volume: rabbitmq - detach: false - net: host - ipc: host - user: root - environment: - TRIPLEO_MINOR_UPDATE: '' - command: /var/lib/container-config-scripts/pacemaker_restart_bundle.sh oslo_messaging_rpc rabbitmq rabbitmq-bundle Started - image: {get_param: ContainerRabbitmqImage} - volumes: - list_concat: - - {get_attr: [ContainersCommon, pacemaker_restart_volumes]} - - - /var/lib/config-data/puppet-generated/rabbitmq:/var/lib/kolla/config_files/src:ro metadata_settings: get_attr: [RabbitmqBase, role_data, metadata_settings] host_prep_tasks: @@ -271,6 +252,21 @@ outputs: vars: container_image: {get_param: ContainerRabbitmqImage} container_image_latest: *rabbitmq_image_pcmklatest + - name: RabbitMQ RPC HA Wrappers Step + when: step|int == 2 + block: &oslo_messaging_rpc_puppet_bundle + - name: Rabbitmq rpc puppet bundle + import_role: + name: tripleo_ha_wrapper + vars: + tripleo_ha_wrapper_service_name: oslo_messaging_rpc + tripleo_ha_wrapper_resource_name: rabbitmq + tripleo_ha_wrapper_bundle_name: rabbitmq-bundle + tripleo_ha_wrapper_resource_state: Started + tripleo_ha_wrapper_puppet_config_volume: rabbitmq + tripleo_ha_wrapper_puppet_execute: 'include ::tripleo::profile::base::pacemaker; include ::tripleo::profile::pacemaker::rabbitmq_bundle' + tripleo_ha_wrapper_puppet_tags: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ip,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation' + tripleo_ha_wrapper_puppet_debug: {get_param: ConfigDebug} update_tasks: - name: Tear-down non-HA rabbitmq container @@ -309,6 +305,13 @@ outputs: when: - old_rabbitmq_image_id.stdout != new_rabbitmq_image_id.stdout + post_update_tasks: + - name: Rabbitmq rpc bundle post update + when: step|int == 1 + block: *oslo_messaging_rpc_puppet_bundle + vars: + tripleo_ha_wrapper_minor_update: true + upgrade_tasks: - name: Tear-down non-HA rabbitmq container when: @@ -419,7 +422,7 @@ outputs: name: tripleo_container_rm vars: tripleo_containers_to_rm: - - rabbitmq_init_bundle + - rabbitmq_wait_bundle when: - oslo_messaging_rpc_short_node_names_upgraded | length > 1 - name: add the oslo_messaging_rpc short name to hiera data for the upgrade.