From 0d2e7159809771bd2a0aceceba21907c6d86e892 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Tue, 1 Nov 2022 08:45:42 +0100 Subject: [PATCH] Setup containerd --- kubernetes/tasks/prerequisites/containerd.yml | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/kubernetes/tasks/prerequisites/containerd.yml b/kubernetes/tasks/prerequisites/containerd.yml index c032481..6ff10b5 100644 --- a/kubernetes/tasks/prerequisites/containerd.yml +++ b/kubernetes/tasks/prerequisites/containerd.yml @@ -1,10 +1,24 @@ +- name: Check if containerd-service exists & is started + service: + name: containerd + state: started + ignore_errors: true + register: containerd_status + +- name: Install containerd when not exists + package: + name: + - containerd + when: containerd_status is failed + +- name: Create containerd config-folder + file: + path: /etc/containerd + state: directory + - name: Deploy containerd-config ansible.builtin.copy: src: containerd_config.toml dest: /etc/containerd/config.toml mode: u=rw,g=r,o=r - -- name: restart_containerd - ansible.builtin.service: - name: containerd - state: restarted + notify: restart_containerd