From 25854d29b9b4cce4a8073079eb73039ff062aad8 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Mon, 3 Jul 2017 12:00:10 +0100 Subject: [PATCH] Hedge upgrade process against no software change Some deployers make use of the new role without implementing a change in the software, resulting in the correct local facts not being deployed. To hedge against this, we add some more conditionals to ensure that the facts are deployed. Change-Id: Iae79ff4f1e0fad35a7bea70da1b8fe0e9c9b5dc7 --- tasks/neutron_install.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tasks/neutron_install.yml b/tasks/neutron_install.yml index 4a1b4df2..81fda2e1 100644 --- a/tasks/neutron_install.yml +++ b/tasks/neutron_install.yml @@ -142,7 +142,7 @@ delay: 2 notify: Restart neutron services -- name: Initialise the db sync local facts +- name: Initialise the upgrade facts ini_file: dest: "/etc/ansible/facts.d/openstack_ansible.fact" section: neutron @@ -153,10 +153,15 @@ state: "True" - name: "need_db_contract" state: "True" - when: neutron_get_venv | changed or - neutron_venv_dir | changed or - install_packages | changed or - install_optional_packages | changed + when: (neutron_get_venv | changed) or + (neutron_venv_dir | changed) or + (install_packages | changed) or + (install_optional_packages | changed) or + (ansible_local is not defined) or + ('openstack_ansible' not in ansible_local) or + ('neutron' not in ansible_local['openstack_ansible']) or + ('need_db_expand' not in ansible_local['openstack_ansible']['neutron']) or + ('need_db_contract' not in ansible_local['openstack_ansible']['neutron']) - name: Record the venv tag deployed ini_file: