--- - name: create containerd config dir ansible.builtin.file: path: /etc/containerd state: directory owner: root group: root mode: 0664 - name: create containerd default config ansible.builtin.shell: cmd: | containerd config default > /etc/containerd/config.toml creates: /etc/containerd/config.toml - name: enable systemd cgroups in containerd config ansible.builtin.lineinfile: path: /etc/containerd/config.toml regexp: '^(.*)SystemdCgroup = false$' line: ' SystemdCgroup = true' backrefs: true state: present