Skip to content

Commit

Permalink
Do not attempt to manage collocated Ceph containers
Browse files Browse the repository at this point in the history
If an HCI EDPM node has Ceph containers, then they
should not be be manged by the edpm_container_manage
role. Add a new task to exclude Ceph containers from
the list of containers built by the call to
containers.podman.podman_container_info.

Without this new task, the edpm_container_manage role
delete_orphan.yml tasks file attempts to process Ceph
containers but it cannot handle them so it fails with
an AttributeError: 'NoneType' object has no attribute
'get'.

Signed-off-by: John Fulton <[email protected]>
  • Loading branch information
fultonj committed Sep 22, 2023
1 parent 594825e commit 69b731a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion roles/edpm_container_manage/tasks/delete_orphan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) }}

0 comments on commit 69b731a

Please sign in to comment.