--- - name: Check podman installation ansible.builtin.shell: | command -v podman changed_when: false failed_when: false register: "is_podman_installed" ignore_errors: true - name: Create container directory ansible.builtin.file: path: "{{ node['home_path'] }}/containers" owner: "{{ ansible_user }}" group: "{{ node['group'] }}" state: "directory" mode: "0700" - name: Create container data directory ansible.builtin.file: path: "{{ node['home_path'] }}/data/containers" owner: "{{ ansible_user }}" group: "{{ node['group'] }}" state: "directory" mode: "0770" when: node['name'] in ["infra", "app"] - name: Create container image archive directory ansible.builtin.file: path: "{{ item }}" owner: "{{ ansible_user }}" group: "{{ node['group'] }}" state: "directory" mode: "0700" loop: - "{{ node['home_path'] }}/archives" - "{{ node['home_path'] }}/archives/containers" - name: Set subid scope (Overwrite) ansible.builtin.copy: content: | {{ ansible_user }}:100000:65536 dest: "/etc/sub{{ item }}" owner: "root" group: "root" mode: "0644" loop: - "uid" - "gid" become: true - name: Install podman ansible.builtin.apt: name: - "podman" state: "present" become: true when: is_podman_installed.rc != 0