From c441ba44103a20f9a0e58c70f3ce785f0d7206fc Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Mon, 10 Jul 2017 16:20:36 +0000 Subject: [PATCH] Do not delete containers named rpc.* If leapfrogging from Kilo (and above) with a host named rpc.* all the containers will be wiped during the step ``neutron-remove-old-containers.yml``. Change-Id: I2e1106bcce12547d6ab9e0384cd96d5e0194001d --- leap-upgrades/upgrade-utilities/neutron-container-forget.sh | 1 + .../upgrade-utilities/neutron-remove-old-containers.yml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/leap-upgrades/upgrade-utilities/neutron-container-forget.sh b/leap-upgrades/upgrade-utilities/neutron-container-forget.sh index 67f563f3..97830821 100755 --- a/leap-upgrades/upgrade-utilities/neutron-container-forget.sh +++ b/leap-upgrades/upgrade-utilities/neutron-container-forget.sh @@ -36,6 +36,7 @@ pushd ${MAIN_PATH}/playbooks REMOVED_CONTAINERS+="$(get_inv_items 'neutron_agent' | awk '{print $2}') " for i in ${REMOVED_CONTAINERS};do + echo "$i" >> /etc/openstack_deploy/leapfrog_remove_remaining_old_containers remove_inv_items $i done diff --git a/leap-upgrades/upgrade-utilities/neutron-remove-old-containers.yml b/leap-upgrades/upgrade-utilities/neutron-remove-old-containers.yml index 3033ba7f..e0fd1a37 100644 --- a/leap-upgrades/upgrade-utilities/neutron-remove-old-containers.yml +++ b/leap-upgrades/upgrade-utilities/neutron-remove-old-containers.yml @@ -18,9 +18,9 @@ gather_facts: false user: root tasks: - - name: Search for and destroy reminent RPC grouped containers + - name: Search for old containers not yet deleted shell: >- - lxc-ls -f | awk '/rpc/ {print $1}' | xargs -n 1 lxc-destroy -fn + while read line; do lxc-destroy -fn $line; done < /etc/openstack_deploy/leapfrog_remove_remaining_old_containers failed_when: false args: executable: /bin/bash