safeaim / podman_rootless

Ansible role that installs Podman, then sets up a service user, the correct SELinux environment, container image and systemd container unit for running the container as a rootless container.
MIT License
0 stars 0 forks source link

Support all container unit parameters #1

Open safeaim opened 8 months ago

safeaim commented 8 months ago

Currently the container.unit jinja2 template only supports a limited set of parameters.

See full list here: podman-systemd.unit - systemd units using Podman Quadlet

safeaim commented 8 months ago
{% macro optional_parameter(variable, line_format)%}
{% if variable is defined %}
{{ line_format|format(variable)}}
{% endif %}
{% endmacro %}
{{ optional_parameter(container_service_description, "Description=%s")-}}

Use this format to avoid 300 lines of if/else