Ansible playbook for deploying and managing Podman containers.
This repo contains two roles, host
and containers
, that automate the deployment of Podman containers using quadlet.
Quadlet files and some understanding of quadlet and/or systemd is required to use this tool.
ansible-playbook host.yml
sudo machinectl shell containers@
ansible-playbook -i docs/sample-environment/wordpress/wordpress.yml containers.yml
- Designed for rootless Podman
- Easily deploy/remove quadlet files and stop/start quadlet services
- Define your application's quadlet files so they are treated as one entity with Ansible
A fully working pod with Wordpress and a MariaDB database are in the docs/sample-environment/wordpress
directory.
The environment variables are in wordpress.yml
, you'll also find the containerfiles and the quadlet files.
- Ansible
- Podman
- User with
sudo
rights (to create unprivileged user)
- Note:
host.yml
andcontainers.yml
will default to execute on localhost if a host isn't provided- This means you can either create a full inventory with a host and variables or just variables that will be run against localhost
host.yml
- installs the needed packages and creates thecontainers
unprivileged user - use with a privileged accountcontainers.yml
- will copy the quadlet files and start the quadlet - use with the unprivileged account
host.yml
:unprivileged-port
- configures host to allow unprivileged accounts to use privileged ports, defaults to80
cpanel-dnsonly
- changes only needed when running on a dnsonly cPanel instance, checkroles/host/tasks/cpanel-dnsonly.yml
for details
containers.yml
:create
- create quadlet filesremove
- remove quadlet filesstart
- start quadlet servicesstop
- stop quadlet services