An Ansible role to setup Podman Quadlet services
Find a file
semantic-release-bot a9b5cbcbbd chore(release): 1.0.1 [skip ci]
## [1.0.1](https://forge.maverick-hq.org/z3r0/ansible-role-podman-quadlet-service/compare/v1.0.0...v1.0.1) (2026-05-02)

### Bug Fixes

* add missing variable to defaults ([97444ef](97444efb79))
2026-05-02 10:01:02 +00:00
.woodpecker ci: restore workflow 2026-04-30 21:43:45 +02:00
defaults fix: add missing variable to defaults 2026-05-02 12:00:26 +02:00
handlers chore: improve style 2026-05-01 21:47:04 +02:00
meta chore: remove useless comments 2026-05-01 11:25:09 +02:00
tasks chore: improve style 2026-05-01 21:47:04 +02:00
.gitignore chore: add .gitignore and requirements.txt 2026-05-01 12:05:17 +02:00
.releaserc ci: force release 2026-04-29 22:18:22 +02:00
CHANGELOG.md chore(release): 1.0.1 [skip ci] 2026-05-02 10:01:02 +00:00
LICENSE docs: add LICENSE 2026-04-29 21:37:16 +02:00
README.md docs: update README.md with missing default variable and examples 2026-05-02 12:00:50 +02:00
requirements.txt chore: improve style 2026-05-01 21:47:04 +02:00

Podman Quadlet Service Ansible role

An Ansible role to deploy Quadlet-based Podman services.

Role Variables

service_name: "generic-service"

The name of the service to deploy.

containers: []

A list of Podman container definitions. Each container definition should receive the same parameters that are described at containers.podman.podman_container module.

create_network: false

Set to true to create a dedicated a Podman network for this service. The network's name will be the same as service_name.

create_pod: false

Set the value to true to create a pod for this service. All the containers defined in containers will belong to this pod. The name of the pod will be the same as servoce_name.

network: {}

A Podman network definition. It should receive the same parameters that are described at containers.podman.podman_network_module.

pod: {}

A podman pod definition. It should receive the same parameters that are described at containers.podman.podman_pod module.

secrets: []

A list of Podman secret definitions. Each secret definition should receive the same parameters that are described at containers.podman.podman_secret module.

service_user: "root"

The name of the user that will execute the service. If the user is not root the service will run in rootless mode. See the rootless tutorial for more info about running containers in rootless mode.

Example playbook

- name: Playbook
  hosts: webservers
  roles:
    - role: ansible-role-podman-quadlet-service
      vars:
        service_name: nginx
        create_network: true
        create_pod: false
        containers:
        - name: nginx
          image: nginx:latest
          env:
            ENV_VAR: "value"
          secrets:
            - my-secret,type=env,target=SECRET_ENV_VAR
          userns: "keep-id:uid=1000,gid=1000"
          volumes:
            - "%h/logs:/var/log/nginx"
          ports:
            - "80:80"
          quadlet_filename: nginx-app
          quadlet_file_mode: "600"
          quadlet_options:
            - |
              [Service]
              Restart=always
            - |
              [Install]
              WantedBy=default.target
        secrets:
          - name: my-secret
            data: "super-secret-value"

License

GPLv3

Author Information

Created with ❤️ by z3r0.