From 47d1430da57e757f8234d1cce65ad5fee46fa21c Mon Sep 17 00:00:00 2001 From: Jiri Stransky Date: Thu, 27 Jun 2019 11:01:33 +0200 Subject: [PATCH] Upgrade fixes for RabbitMQ and Pacemaker Override also RabbitMQ long node names (FQDNs) in addition to the short node names we've been already overriding. This allows RabbitMQ to start correctly. Also remove a superfluous when condition in the pacemaker validation task. Depends-On: Ia152aed696be15119ba5b75177ef82bc786c4b05 Change-Id: I9eb274071f3fc2258addd9d2f0c1a5406a702573 Closes-Bug: #1832588 --- .../pacemaker/pacemaker-baremetal-puppet.yaml | 1 - ...tmq-messaging-notify-pacemaker-puppet.yaml | 26 ++++++++++++++----- ...bbitmq-messaging-rpc-pacemaker-puppet.yaml | 24 +++++++++++++---- 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/deployment/pacemaker/pacemaker-baremetal-puppet.yaml b/deployment/pacemaker/pacemaker-baremetal-puppet.yaml index 6e9c75c9f8..311123b949 100644 --- a/deployment/pacemaker/pacemaker-baremetal-puppet.yaml +++ b/deployment/pacemaker/pacemaker-baremetal-puppet.yaml @@ -170,7 +170,6 @@ outputs: upgrade_leapp_enabled: {get_param: UpgradeLeappEnabled} block: - name: Check pacemaker cluster running before upgrade - when: step|int == 0 tags: validation pacemaker_cluster: state=online check_and_fail=true async: 30 diff --git a/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml b/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml index be5edf2d70..cd52f4225a 100644 --- a/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml +++ b/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml @@ -314,25 +314,29 @@ outputs: - name: set oslo_messaging_notify upgrade node facts in a single-node environment set_fact: oslo_messaging_notify_short_node_names_upgraded: "{{ oslo_messaging_notify_short_node_names }}" + oslo_messaging_notify_node_names_upgraded: "{{ oslo_messaging_notify_node_names }}" cacheable: no when: groups['oslo_messaging_notify'] | length == 1 - name: set oslo_messaging_notify upgrade node facts from the limit option set_fact: oslo_messaging_notify_short_node_names_upgraded: "{{ oslo_messaging_notify_short_node_names_upgraded|default([]) + [item.split('.')[0]] }}" + oslo_messaging_notify_node_names_upgraded: "{{ oslo_messaging_notify_node_names_upgraded|default([]) + [item] }}" cacheable: no when: item.split('.')[0] in ansible_limit.split(',') - loop: "{{ oslo_messaging_notify_short_node_names }}" + loop: "{{ oslo_messaging_notify_node_names }}" - debug: msg: "Prepare oslo_messaging_notify upgrade for {{ oslo_messaging_notify_short_node_names_upgraded }}" - fail: msg: > - You can't upgrade oslo_messaging_notify without staged - upgrade. You need to use the limit option in order + You can't upgrade oslo_messaging_notify without + staged upgrade. You need to use the limit option in order to do so. when: >- oslo_messaging_notify_short_node_names_upgraded is not defined or - oslo_messaging_notify_short_node_names_upgraded | length == 0 + oslo_messaging_notify_short_node_names_upgraded | length == 0 or + oslo_messaging_notify_node_names_upgraded is not defined or + oslo_messaging_notify_node_names_upgraded | length == 0 - name: add the oslo_messaging_notify short name to hiera data for the upgrade. include_role: @@ -341,13 +345,23 @@ outputs: vars: tripleo_upgrade_key: oslo_messaging_notify_short_node_names_override tripleo_upgrade_value: "{{oslo_messaging_notify_short_node_names_upgraded}}" + - name: add the oslo_messaging_notify long name to hiera data for the upgrade + include_role: + name: tripleo-upgrade-hiera + tasks_from: set.yml + vars: + tripleo_upgrade_key: oslo_messaging_notify_node_names_override + tripleo_upgrade_value: "{{oslo_messaging_notify_node_names_upgraded}}" - name: remove the extra hiera data needed for the upgrade. include_role: name: tripleo-upgrade-hiera tasks_from: remove.yml vars: - tripleo_upgrade_key: oslo_messaging_notify_short_node_names_override - when: oslo_messaging_notify_short_node_names_upgraded | length == oslo_messaging_notify_short_node_names | length + tripleo_upgrade_key: "{{item}}" + loop: + - oslo_messaging_notify_short_node_names_override + - oslo_messaging_notify_node_names_override + when: oslo_messaging_notify_short_node_names_upgraded | length == oslo_messaging_notify_node_names | length - when: step|int == 0 tags: common block: diff --git a/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml b/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml index b692def759..bd35bd8125 100644 --- a/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml +++ b/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml @@ -313,25 +313,29 @@ outputs: - name: set oslo_messaging_rpc upgrade node facts in a single-node environment set_fact: oslo_messaging_rpc_short_node_names_upgraded: "{{ oslo_messaging_rpc_short_node_names }}" + oslo_messaging_rpc_node_names_upgraded: "{{ oslo_messaging_rpc_node_names }}" cacheable: no when: groups['oslo_messaging_rpc'] | length == 1 - name: set oslo_messaging_rpc upgrade node facts from the limit option set_fact: oslo_messaging_rpc_short_node_names_upgraded: "{{ oslo_messaging_rpc_short_node_names_upgraded|default([]) + [item.split('.')[0]] }}" + oslo_messaging_rpc_node_names_upgraded: "{{ oslo_messaging_rpc_node_names_upgraded|default([]) + [item] }}" cacheable: no when: item.split('.')[0] in ansible_limit.split(',') - loop: "{{ oslo_messaging_rpc_short_node_names }}" + loop: "{{ oslo_messaging_rpc_node_names }}" - debug: msg: "Prepare oslo_messaging_rpc upgrade for {{ oslo_messaging_rpc_short_node_names_upgraded }}" - fail: msg: > You can't upgrade oslo_messaging_rpc without staged - upgrade. You need to use the limit option in order + upgrade. You need to use the limit option in order to do so. when: >- oslo_messaging_rpc_short_node_names_upgraded is not defined or - oslo_messaging_rpc_short_node_names_upgraded | length == 0 + oslo_messaging_rpc_short_node_names_upgraded | length == 0 or + oslo_messaging_rpc_node_names_upgraded is not defined or + oslo_messaging_rpc_node_names_upgraded | length == 0 - name: add the oslo_messaging_rpc short name to hiera data for the upgrade. include_role: @@ -340,13 +344,23 @@ outputs: vars: tripleo_upgrade_key: oslo_messaging_rpc_short_node_names_override tripleo_upgrade_value: "{{oslo_messaging_rpc_short_node_names_upgraded}}" + - name: add the oslo_messaging_rpc long name to hiera data for the upgrade + include_role: + name: tripleo-upgrade-hiera + tasks_from: set.yml + vars: + tripleo_upgrade_key: oslo_messaging_rpc_node_names_override + tripleo_upgrade_value: "{{oslo_messaging_rpc_node_names_upgraded}}" - name: remove the extra hiera data needed for the upgrade. include_role: name: tripleo-upgrade-hiera tasks_from: remove.yml vars: - tripleo_upgrade_key: oslo_messaging_rpc_short_node_names_override - when: oslo_messaging_rpc_short_node_names_upgraded | length == oslo_messaging_rpc_short_node_names | length + tripleo_upgrade_key: "{{item}}" + loop: + - oslo_messaging_rpc_short_node_names_override + - oslo_messaging_rpc_node_names_override + when: oslo_messaging_rpc_short_node_names_upgraded | length == oslo_messaging_rpc_node_names | length - name: Get docker Rabbitmq image set_fact: rabbitmq_docker_image_latest: *rabbitmq_image_pcmklatest