cleanup: don't cleanup runc orphan binary on immutable distros (#12669)

This commit is contained in:
Max Gautier
2025-11-07 06:16:53 +00:00
committed by GitHub
parent f5a480fdc4
commit b9662dbd86

View File

@@ -12,11 +12,20 @@
is_ostree: "{{ ostree.stat.exists }}" is_ostree: "{{ ostree.stat.exists }}"
- name: Runc | Uninstall runc package managed by package manager - name: Runc | Uninstall runc package managed by package manager
when:
- not is_ostree
- ansible_distribution != "Flatcar Container Linux by Kinvolk"
- ansible_distribution != "Flatcar"
block:
- name: Runc | Remove package
package: package:
name: "{{ runc_package_name }}" name: "{{ runc_package_name }}"
state: absent state: absent
when: - name: Runc | Remove orphaned binary
- not (is_ostree or (ansible_distribution == "Flatcar Container Linux by Kinvolk") or (ansible_distribution == "Flatcar")) file:
path: /usr/bin/runc
state: absent
when: runc_bin_dir != "/usr/bin"
- name: Runc | Download runc binary - name: Runc | Download runc binary
include_tasks: "../../../download/tasks/download_file.yml" include_tasks: "../../../download/tasks/download_file.yml"
@@ -29,10 +38,3 @@
dest: "{{ runc_bin_dir }}/runc" dest: "{{ runc_bin_dir }}/runc"
mode: "0755" mode: "0755"
remote_src: true remote_src: true
- name: Runc | Remove orphaned binary
file:
path: /usr/bin/runc
state: absent
when: runc_bin_dir != "/usr/bin"
ignore_errors: true # noqa ignore-errors