role_podman/templates/podman-quadlet.container.j2

39 lines
771 B
Plaintext
Raw Normal View History

2023-12-21 16:30:57 +00:00
# {{ ansible_managed }}
[Unit]
2024-02-12 16:02:30 +00:00
Description=Podman container: {{ container.name }}
2024-02-12 16:12:00 +00:00
{% for option, value in container.get('unit_extras', {}).items() %}
2024-02-12 16:02:30 +00:00
{{ option }}={{ value }}
{% endfor %}
2023-12-21 16:30:57 +00:00
[Container]
HostName={{ inventory_hostname }}
Image={{ container.image }}
ContainerName={{ container.name }}
{% if container.get('userns', '') | length > 0 %}
UserNS={{ container.userns }}
{% endif %}
AutoUpdate=registry
{% for volume in container.get('volumes', []) %}
Volume={{ volume }}
{% endfor %}
{% for port in container.get('ports', []) %}
PublishPort={{ port }}
{% endfor %}
{% for environment in container.get('environment_vars', []) %}
Environment={{ environment }}
{% endfor %}
[Service]
Restart=on-failure
TimeoutStartSec=900
[Install]
WantedBy=default.target