From e26009fa9c57d42a0c82ebc22169e10741005946 Mon Sep 17 00:00:00 2001 From: Jiri Stransky Date: Fri, 9 Aug 2019 15:52:29 +0200 Subject: [PATCH] Check for rc instead of |succeeded We went from `ignore_errors: true` to `failed_when: false` to prevent Ansible printing errors which aren't really errors. When using `succeeded` filter on a registered variable from such task, we will always get true, which is not what we want. Check for `.rc == 0` instead to set the facts as they were intended. Change-Id: Ib8dea68720fda86cf4fd879cdf194d206968f6fb Partial-Bug: #1831690 --- deployment/cinder/cinder-backup-pacemaker-puppet.yaml | 2 +- deployment/cinder/cinder-volume-pacemaker-puppet.yaml | 2 +- deployment/database/mysql-pacemaker-puppet.yaml | 2 +- deployment/database/redis-pacemaker-puppet.yaml | 2 +- deployment/haproxy/haproxy-pacemaker-puppet.yaml | 2 +- deployment/manila/manila-share-pacemaker-puppet.yaml | 2 +- .../rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml | 2 +- deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml | 2 +- .../rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/deployment/cinder/cinder-backup-pacemaker-puppet.yaml b/deployment/cinder/cinder-backup-pacemaker-puppet.yaml index 3d5e110a05..6c23a79dde 100644 --- a/deployment/cinder/cinder-backup-pacemaker-puppet.yaml +++ b/deployment/cinder/cinder-backup-pacemaker-puppet.yaml @@ -308,7 +308,7 @@ outputs: register: cinder_backup_pcs_res_result - name: Set fact cinder_backup_pcs_res set_fact: - cinder_backup_pcs_res: "{{cinder_backup_pcs_res_result|succeeded}}" + cinder_backup_pcs_res: "{{cinder_backup_pcs_res_result.rc == 0}}" - name: set is_cinder_backup_bootstrap_node fact tags: common set_fact: is_cinder_backup_bootstrap_node={{cinder_backup_short_bootstrap_node_name|lower == ansible_hostname|lower}} diff --git a/deployment/cinder/cinder-volume-pacemaker-puppet.yaml b/deployment/cinder/cinder-volume-pacemaker-puppet.yaml index 6c741be3bf..b54e6fa3f0 100644 --- a/deployment/cinder/cinder-volume-pacemaker-puppet.yaml +++ b/deployment/cinder/cinder-volume-pacemaker-puppet.yaml @@ -301,7 +301,7 @@ outputs: register: cinder_volume_pcs_res_result - name: Set fact cinder_volume_pcs_res set_fact: - cinder_volume_pcs_res: "{{cinder_volume_pcs_res_result|succeeded}}" + cinder_volume_pcs_res: "{{cinder_volume_pcs_res_result.rc == 0}}" - name: set is_cinder_volume_bootstrap_node fact tags: common set_fact: is_cinder_volume_bootstrap_node={{cinder_volume_short_bootstrap_node_name|lower == ansible_hostname|lower}} diff --git a/deployment/database/mysql-pacemaker-puppet.yaml b/deployment/database/mysql-pacemaker-puppet.yaml index ec940dc63a..2a75795cfd 100644 --- a/deployment/database/mysql-pacemaker-puppet.yaml +++ b/deployment/database/mysql-pacemaker-puppet.yaml @@ -453,7 +453,7 @@ outputs: register: galera_pcs_res_result - name: Set fact galera_pcs_res set_fact: - galera_pcs_res: "{{galera_pcs_res_result|succeeded}}" + galera_pcs_res: "{{galera_pcs_res_result.rc == 0}}" - name: set is_mysql_bootstrap_node fact tags: common set_fact: is_mysql_bootstrap_node={{mysql_short_bootstrap_node_name|lower == ansible_hostname|lower}} diff --git a/deployment/database/redis-pacemaker-puppet.yaml b/deployment/database/redis-pacemaker-puppet.yaml index fa98d6d2b7..5af9593e08 100644 --- a/deployment/database/redis-pacemaker-puppet.yaml +++ b/deployment/database/redis-pacemaker-puppet.yaml @@ -391,7 +391,7 @@ outputs: register: redis_pcs_res_result - name: Set upgrade redis facts set_fact: - redis_pcs_res: "{{redis_pcs_res_result|succeeded}}" + redis_pcs_res: "{{redis_pcs_res_result.rc == 0}}" is_redis_bootstrap_node: "{{redis_short_bootstrap_node_name|lower == ansible_hostname|lower}}" - name: Update redis-bundle pcs resource bundle for new container image when: diff --git a/deployment/haproxy/haproxy-pacemaker-puppet.yaml b/deployment/haproxy/haproxy-pacemaker-puppet.yaml index fe75f72ebe..5577f769d6 100644 --- a/deployment/haproxy/haproxy-pacemaker-puppet.yaml +++ b/deployment/haproxy/haproxy-pacemaker-puppet.yaml @@ -471,7 +471,7 @@ outputs: register: haproxy_pcs_res_result - name: Set upgrade haproxy facts set_fact: - haproxy_pcs_res: "{{haproxy_pcs_res_result|succeeded}}" + haproxy_pcs_res: "{{haproxy_pcs_res_result.rc == 0}}" is_haproxy_bootstrap_node: "{{haproxy_short_bootstrap_node_name|lower == ansible_hostname|lower}}" - name: Update haproxy pcs resource bundle for new container image diff --git a/deployment/manila/manila-share-pacemaker-puppet.yaml b/deployment/manila/manila-share-pacemaker-puppet.yaml index 8c206ee365..495845eb20 100644 --- a/deployment/manila/manila-share-pacemaker-puppet.yaml +++ b/deployment/manila/manila-share-pacemaker-puppet.yaml @@ -293,7 +293,7 @@ outputs: register: manila_share_pcs_res_result - name: Set fact manila_share_pcs_res set_fact: - manila_share_pcs_res: "{{manila_share_pcs_res_result|succeeded}}" + manila_share_pcs_res: "{{manila_share_pcs_res_result.rc == 0}}" - name: set is_manila_share_bootstrap_node fact tags: common set_fact: is_manila_share_bootstrap_node={{manila_share_short_bootstrap_node_name|lower == ansible_hostname|lower}} diff --git a/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml b/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml index 1bdf1364d5..2b0b41d951 100644 --- a/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml +++ b/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml @@ -350,7 +350,7 @@ outputs: register: rabbitmq_pcs_res_result - name: Set fact rabbitmq_pcs_res set_fact: - rabbitmq_pcs_res: "{{rabbitmq_pcs_res_result|succeeded}}" + rabbitmq_pcs_res: "{{rabbitmq_pcs_res_result.rc == 0}}" - name: set is_notify_rabbitmq_bootstrap_node fact set_fact: is_notify_rabbitmq_bootstrap_node={{oslo_messaging_notify_short_bootstrap_node_name|lower == ansible_hostname|lower}} - name: Update rabbitmq-bundle pcs resource bundle for new container image diff --git a/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml b/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml index 735d7e6506..babba7ec00 100644 --- a/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml +++ b/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml @@ -350,7 +350,7 @@ outputs: register: rabbitmq_pcs_res_result - name: Set fact rabbitmq_pcs_res set_fact: - rabbitmq_pcs_res: "{{rabbitmq_pcs_res_result|succeeded}}" + rabbitmq_pcs_res: "{{rabbitmq_pcs_res_result.rc == 0}}" - name: set is_rabbitmq_bootstrap_node fact tags: common set_fact: is_rabbitmq_bootstrap_node={{rabbitmq_short_bootstrap_node_name|lower == ansible_hostname|lower}} diff --git a/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml b/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml index 0c0aee12f1..9cab2c5436 100644 --- a/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml +++ b/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml @@ -350,7 +350,7 @@ outputs: register: rabbitmq_pcs_res_result - name: Set fact rabbitmq_pcs_res set_fact: - rabbitmq_pcs_res: "{{rabbitmq_pcs_res_result|succeeded}}" + rabbitmq_pcs_res: "{{rabbitmq_pcs_res_result.rc == 0}}" - name: set is_rpc_rabbitmq_bootstrap_node fact set_fact: is_rpc_rabbitmq_bootstrap_node={{oslo_messaging_rpc_short_bootstrap_node_name|lower == ansible_hostname|lower}} - name: Update rabbitmq-bundle pcs resource bundle for new container image