--- - name: "Install Podman" become: true ansible.builtin.package: name: "podman" state: "present" - name: "Enable and start Podman socket service" become: true ansible.builtin.systemd_service: name: "podman.socket" enabled: true state: started - name: "Configure Podman for rootless operation" ansible.builtin.command: cmd: "loginctl enable-linger {{ ansible_facts['user_uid'] }}" become: true changed_when: false failed_when: false - name: "Create containers configuration directory" ansible.builtin.file: path: "{{ ansible_facts['env']['HOME'] }}/.config/containers" state: "directory" mode: "0755" - name: "Configure Podman containers.conf" ansible.builtin.copy: dest: "{{ ansible_facts['env']['HOME'] }}/.config/containers/containers.conf" mode: "0644" content: | # Use systemd cgroup manager for proper integration with the host's # resource management on cgroup v2 systems. Requires cgroup delegation # (cpu, memory, pids controllers) in the user's systemd slice. [engine] cgroup_manager = "systemd" # Lower the default pasta MTU to prevent intermittent TLS errors # (SSL_ERROR_SYSCALL, unexpected eof) caused by packet fragmentation # in rootless podman's pasta networking layer. [network] pasta_options = ["--mtu", "1280"] - name: "Configure container registries" become: true ansible.builtin.copy: dest: "/etc/containers/registries.conf" mode: "0644" content: | unqualified-search-registries = ["docker.io"] [[registry]] location = "docker.io"