From d71a54294d9855a65ed31fabf6727f88865ee4b2 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Fri, 8 Nov 2019 12:37:36 +0100 Subject: [PATCH] Relax needs_delete() filter Don't remove a container when all these conditions are met: - the container is part of the config_id - the container is running - the container isn't in the tripleo_container_manage_config path. The reason is, we'll let operators to deploy containers individually, so we don't want to touch other containers not in the config at that time. Example: as an operator I want to apply ansible on haproxy (config_step1); so I don't want other containers from config_step1 to be removed. This code was here to cleanup containers not part of the config (e.g. if you upgrade and a container isn't used anymore); but it's too agressive. If a container isn't needed anymore, it'll need to be handled during the upgrade steps. Change-Id: I3103f642ba86111e02d06922876b5f1ac78df602 (cherry picked from commit 94d52bc00f4e0af3b55b1c5c8ccd03f9bea68c36) --- tripleo_ansible/ansible_plugins/filter/helpers.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tripleo_ansible/ansible_plugins/filter/helpers.py b/tripleo_ansible/ansible_plugins/filter/helpers.py index f94350e3b..6f5d6cb20 100644 --- a/tripleo_ansible/ansible_plugins/filter/helpers.py +++ b/tripleo_ansible/ansible_plugins/filter/helpers.py @@ -109,13 +109,6 @@ class FilterModule(object): to_delete += [c_name] continue - # Remove containers managed by tripleo-ansible that aren't in - # config e.g. containers not needed anymore and removed by an - # upgrade. Note: we don't cleanup paunch-managed containers. - if c_name not in config: - to_delete += [c_name] - continue - for c_name, config_data in config.items(): # don't try to remove a container which doesn't exist if c_name not in installed_containers: