You've already forked role_podman
refactor: Use alvistack repository
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
[Unit]
|
||||
Description=Podman container: {{ container.name }}
|
||||
{% for extra in container.get('unit_extras', []) %}
|
||||
{{ extra }}
|
||||
{% endfor %}
|
||||
|
||||
[Container]
|
||||
HostName={{ inventory_hostname }}
|
||||
|
||||
Image={{ container.image }}
|
||||
ContainerName={{ container.name }}
|
||||
|
||||
{% if container.get('userns', '') | length > 0 %}
|
||||
UserNS={{ container.userns }}
|
||||
{% endif %}
|
||||
|
||||
AutoUpdate=registry
|
||||
|
||||
{% for cmd in container.get('commands', []) %}
|
||||
Exec={{ cmd }}
|
||||
{% endfor %}
|
||||
|
||||
{% for volume in container.get('volumes', []) %}
|
||||
Volume={{ volume }}
|
||||
{% endfor %}
|
||||
|
||||
{% for mount in container.get('mounts', []) %}
|
||||
{% if mount.get('options', []) | length > 0 %}
|
||||
Mount=type={{ mount.type }},src={{ mount.source }},dst={{ mount.destination }},{{ mount.options | join(',') }}
|
||||
{% else %}
|
||||
Mount=type={{ mount.type }},src={{ mount.source }},dst={{ mount.destination }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% for port in container.get('ports', []) %}
|
||||
PublishPort={{ port }}
|
||||
{% endfor %}
|
||||
|
||||
{% for environment in container.get('environment_vars', []) %}
|
||||
Environment={{ environment.keys() | first }}={{ environment.values() | first }}
|
||||
{% endfor %}
|
||||
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
TimeoutStartSec=900
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
Reference in New Issue
Block a user