diff --git a/roles/edpm_container_manage/tasks/delete_orphan.yml b/roles/edpm_container_manage/tasks/delete_orphan.yml index 179488002..d1f09b933 100644 --- a/roles/edpm_container_manage/tasks/delete_orphan.yml +++ b/roles/edpm_container_manage/tasks/delete_orphan.yml @@ -20,6 +20,13 @@ when: - edpm_container_manage_cli == 'podman' +- name: Exclude Ceph containers from podman container list + ansible.builtin.set_fact: + filtered_containers: "{{ filtered_containers | default([]) + [item] }}" + when: + - not (item['Name'] | regex_search('^ceph.*')) + loop: "{{ podman_containers.containers }}" + - name: "Delete orphan containers managed by Podman for {{ edpm_container_manage_config }}" when: - edpm_container_manage_systemd_teardown | bool @@ -28,6 +35,7 @@ vars: edpm_container_cli: "{{ edpm_container_manage_cli }}" edpm_containers_to_rm: >- - {{ podman_containers.containers | osp.edpm.needs_delete(config=all_containers_hash, + {{ filtered_containers | default([]) | + osp.edpm.needs_delete(config=all_containers_hash, config_id=edpm_container_manage_config_id, check_config=False, clean_orphans=True) }}