From 08ccd4745c63483d912f4ab5364e6345046793a7 Mon Sep 17 00:00:00 2001 From: Antony Messerli Date: Fri, 26 Apr 2019 13:32:08 -0500 Subject: [PATCH] Remove keystone directory on source installs Current behavior only attempts to remove the keystone directory from the first container and skips additional containers past the first one. This caused upgrades to break as the configs were still present in any additional containers. This ensures the keystone directory is removed on all keystone containers when the install method is is source. Change-Id: If588f9ed4bc5d0deeb2b9c1bbeea5e9eb5ce7c79 --- tasks/keystone_pre_install.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tasks/keystone_pre_install.yml b/tasks/keystone_pre_install.yml index 283f52fd..41343d64 100644 --- a/tasks/keystone_pre_install.yml +++ b/tasks/keystone_pre_install.yml @@ -71,16 +71,22 @@ stat: path: "/etc/keystone" register: keystone_conf_dir_stat + with_items: + - "{{ ansible_play_hosts }}" - name: Remove the config directory file: path: "/etc/keystone" state: absent + with_items: + - "{{ keystone_conf_dir_stat.results }}" + delegate_to: "{{ item.item }}" when: - - keystone_conf_dir_stat.stat.isdir is defined and - keystone_conf_dir_stat.stat.isdir + - item.stat.isdir is defined and + item.stat.isdir when: - keystone_install_method == 'source' + - "inventory_hostname == ansible_play_hosts[0]" # The fernet key repository is needed on all hosts even if only running against # one host, so the delegation preps the directories on all hosts at once.