diff --git a/deployment/podman/podman-baremetal-ansible.yaml b/deployment/podman/podman-baremetal-ansible.yaml index 4d52327814..b8b7996359 100644 --- a/deployment/podman/podman-baremetal-ansible.yaml +++ b/deployment/podman/podman-baremetal-ansible.yaml @@ -68,6 +68,10 @@ parameters: additional ordering dependencies for the systemd scopes associated to podman containers. type: boolean + deployment_source_hosts: + default: 'Undercloud' + type: string + description: Host or hostgroup that runs the deployment conditions: insecure_registry_is_empty: {equals : [{get_param: DockerInsecureRegistryAddress}, []]} @@ -221,19 +225,37 @@ outputs: when: pcs_stat.stat.exists post_upgrade_tasks: + # Podman purge tasks are disabled on the undercloud since the ephemeral + # Heat images need to be kept. When commit + # https://github.com/containers/podman/commit/a5ad36c65ea07d839fd9bf55a820c8cb9884eed1 + # is available in the podman version used by TripleO, the ephemeral + # Heat images could be labeled in a way that they could be kept with + # --fitler, and these tasks could be re-enabled on the undercloud. - name: Purge Podman when: - (step | int) == 3 - container_cli == 'podman' + - deployment_source_hosts not in group_names include_role: name: tripleo_podman tasks_from: tripleo_podman_purge.yml + vars: + deployment_source_hosts: {get_param: deployment_source_hosts} post_update_tasks: + # Podman purge tasks are disabled on the undercloud since the ephemeral + # Heat images need to be kept. When commit + # https://github.com/containers/podman/commit/a5ad36c65ea07d839fd9bf55a820c8cb9884eed1 + # is available in the podman version used by TripleO, the ephemeral + # Heat images could be labeled in a way that they could be kept with + # --fitler, and these tasks could be re-enabled on the undercloud. - name: Purge Podman when: - (step | int) == 3 - container_cli == 'podman' + - deployment_source_hosts not in group_names include_role: name: tripleo_podman tasks_from: tripleo_podman_purge.yml + vars: + deployment_source_hosts: {get_param: deployment_source_hosts} diff --git a/releasenotes/notes/skip-podman-purge-undercloud-a3a30b5ac3a0951b.yaml b/releasenotes/notes/skip-podman-purge-undercloud-a3a30b5ac3a0951b.yaml new file mode 100644 index 0000000000..e2ad1facce --- /dev/null +++ b/releasenotes/notes/skip-podman-purge-undercloud-a3a30b5ac3a0951b.yaml @@ -0,0 +1,9 @@ +--- +other: + - | + "podman image prune" is no longer used on the undercloud to remove unused + images during the undercloud update/upgrade. With the usage of ephemeral + Heat, not all images will always be used by running or stopped containers, + so "podman image prune" should not be used to clean up the local container + image storage. Images that are no longer being used can still be removed + individually with "podman rmi".