sr2c.podman.podman_host role – Prepare a host and its users for rootless Podman
Note
This role is part of the sr2c.podman collection (version 0.0.1).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it use: ansible-galaxy collection install sr2c.podman.
To use it in a playbook, specify: sr2c.podman.podman_host.
Entry point main – Prepare a host and its users for rootless Podman
Synopsis
Installs Podman,
container-selinuxandshadow-utils-subidwithdnf, and prepares each user inpodman_host_rootless_usersto run rootless containers managed by systemd.The users must already exist and have subordinate UID and GID ranges; the role checks this but does not create them.
For each user, enables lingering so their services run without a login session, sets
XDG_RUNTIME_DIRin~/.bashrcand~/.bash_profile, creates~/.config/containers/systemdfor quadlets, points Podman’sTMPDIRat~/.local/tmp, and enablespodman-auto-update.timer.Removes
/etc/containers.confand/etc/containers/containers.conf, so each user’s owncontainers.confapplies. This affects every Podman user on the host.When
podman_host_minimum_unpriv_portis set, setsnet.ipv4.ip_unprivileged_port_startto it, at runtime and in/etc/sysctl.d/zzz-podman-unpriv-port.conf. The setting applies to the whole host, so every user can bind ports from that number up.
Parameters
Parameter |
Comments |
|---|---|
The lowest port that unprivileged users can bind, from When not set, the role leaves |
|
The users to prepare for rootless Podman. Must not be empty or include |