diff --git a/roles/container-engine/containerd/tasks/main.yml b/roles/container-engine/containerd/tasks/main.yml index 4a76a192acb..3b9899333e5 100644 --- a/roles/container-engine/containerd/tasks/main.yml +++ b/roles/container-engine/containerd/tasks/main.yml @@ -57,6 +57,19 @@ - --strip-components=1 notify: restart containerd +- name: containerd | Remove orphaned binary + file: + path: "/usr/bin/{{ item }}" + state: absent + when: "{{ containerd_bin_dir }} != /usr/bin " + ignore_errors: true # noqa ignore-errors + with_items: + - containerd + - containerd-shim + - containerd-shim-runc-v1 + - containerd-shim-runc-v2 + - ctr + - name: containerd | Generate systemd service for containerd template: src: containerd.service.j2 diff --git a/roles/container-engine/runc/tasks/main.yml b/roles/container-engine/runc/tasks/main.yml index 9608ca970ac..a009d4eec9b 100644 --- a/roles/container-engine/runc/tasks/main.yml +++ b/roles/container-engine/runc/tasks/main.yml @@ -21,3 +21,10 @@ dest: "{{ runc_bin_dir }}/runc" mode: 0755 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