- name: Install containerd apt: name: containerd state: present update_cache: yes - name: Ensure containerd config directory file: path: /etc/containerd state: directory mode: '0755' - name: Generate default config shell: containerd config default > /etc/containerd/config.toml args: { creates: /etc/containerd/config.toml } - name: Ensure SystemdCgroup=true replace: path: /etc/containerd/config.toml regexp: 'SystemdCgroup = false' replace: 'SystemdCgroup = true' - name: Restart containerd service: name: containerd state: restarted enabled: yes