From 6b283430173caf0d0ecabce55dfa62abfe68787a Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Sat, 7 Nov 2015 16:40:17 +0000 Subject: [PATCH] Incorrect parsed variable name database_user_create was not correctly referenced when parsing the variable names. This could never actually lead to a situation that reported a false change, but it could break an operation if you were using the --step option with ansible and skipped the database create task. TrivialFix Backport: Liberty Change-Id: Idf69fffcc3814f509448ccea11b7d175f074ccf1 --- ansible/roles/cinder/tasks/bootstrap.yml | 2 +- ansible/roles/glance/tasks/bootstrap.yml | 2 +- ansible/roles/heat/tasks/bootstrap.yml | 2 +- ansible/roles/ironic/tasks/bootstrap.yml | 2 +- ansible/roles/keystone/tasks/bootstrap.yml | 2 +- ansible/roles/murano/tasks/bootstrap.yml | 2 +- ansible/roles/neutron/tasks/bootstrap.yml | 2 +- ansible/roles/nova/tasks/bootstrap.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ansible/roles/cinder/tasks/bootstrap.yml b/ansible/roles/cinder/tasks/bootstrap.yml index b0a949f8f1..cf8f434138 100644 --- a/ansible/roles/cinder/tasks/bootstrap.yml +++ b/ansible/roles/cinder/tasks/bootstrap.yml @@ -23,7 +23,7 @@ priv='{{ cinder_database_name }}.*:ALL' append_privs='yes'" register: database_user_create - changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" + changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" failed_when: database_user_create.stdout.split()[2] != 'SUCCESS' run_once: True diff --git a/ansible/roles/glance/tasks/bootstrap.yml b/ansible/roles/glance/tasks/bootstrap.yml index fe62557bdc..77a3914601 100644 --- a/ansible/roles/glance/tasks/bootstrap.yml +++ b/ansible/roles/glance/tasks/bootstrap.yml @@ -24,7 +24,7 @@ priv='{{ glance_database_name }}.*:ALL' append_privs='yes'" register: database_user_create - changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" + changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" failed_when: database_user_create.stdout.split()[2] != 'SUCCESS' run_once: True diff --git a/ansible/roles/heat/tasks/bootstrap.yml b/ansible/roles/heat/tasks/bootstrap.yml index 0c8e3920b4..7a00dd931e 100644 --- a/ansible/roles/heat/tasks/bootstrap.yml +++ b/ansible/roles/heat/tasks/bootstrap.yml @@ -23,7 +23,7 @@ priv='{{ heat_database_name }}.*:ALL' append_privs='yes'" register: database_user_create - changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" + changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" failed_when: database_user_create.stdout.split()[2] != 'SUCCESS' run_once: True diff --git a/ansible/roles/ironic/tasks/bootstrap.yml b/ansible/roles/ironic/tasks/bootstrap.yml index 0d55efc459..1e63a1a372 100644 --- a/ansible/roles/ironic/tasks/bootstrap.yml +++ b/ansible/roles/ironic/tasks/bootstrap.yml @@ -25,7 +25,7 @@ priv='{{ ironic_database_name }}.*:ALL' append_privs='yes'" register: database_user_create - changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" + changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" failed_when: database_user_create.stdout.split()[2] != 'SUCCESS' run_once: True diff --git a/ansible/roles/keystone/tasks/bootstrap.yml b/ansible/roles/keystone/tasks/bootstrap.yml index 34ee7b31ae..8056796ab1 100644 --- a/ansible/roles/keystone/tasks/bootstrap.yml +++ b/ansible/roles/keystone/tasks/bootstrap.yml @@ -25,7 +25,7 @@ priv='{{ keystone_database_name }}.*:ALL' append_privs='yes'" register: database_user_create - changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" + changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" failed_when: database_user_create.stdout.split()[2] != 'SUCCESS' run_once: True diff --git a/ansible/roles/murano/tasks/bootstrap.yml b/ansible/roles/murano/tasks/bootstrap.yml index 5d73debc71..a6c08baa87 100644 --- a/ansible/roles/murano/tasks/bootstrap.yml +++ b/ansible/roles/murano/tasks/bootstrap.yml @@ -24,7 +24,7 @@ priv='{{ murano_database_name }}.*:ALL' append_privs='yes'" register: database_user_create - changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" + changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" failed_when: database_user_create.stdout.split()[2] != 'SUCCESS' run_once: True diff --git a/ansible/roles/neutron/tasks/bootstrap.yml b/ansible/roles/neutron/tasks/bootstrap.yml index 36b4f96476..ebb6cab5dc 100644 --- a/ansible/roles/neutron/tasks/bootstrap.yml +++ b/ansible/roles/neutron/tasks/bootstrap.yml @@ -23,7 +23,7 @@ priv='{{ neutron_database_name }}.*:ALL' append_privs='yes'" register: database_user_create - changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" + changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" failed_when: database_user_create.stdout.split()[2] != 'SUCCESS' run_once: True diff --git a/ansible/roles/nova/tasks/bootstrap.yml b/ansible/roles/nova/tasks/bootstrap.yml index d81dddc3ad..7b7a5ed163 100644 --- a/ansible/roles/nova/tasks/bootstrap.yml +++ b/ansible/roles/nova/tasks/bootstrap.yml @@ -23,7 +23,7 @@ priv='{{ nova_database_name }}.*:ALL' append_privs='yes'" register: database_user_create - changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" + changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" failed_when: database_user_create.stdout.split()[2] != 'SUCCESS' run_once: True