29 lines
788 B
Django/Jinja
29 lines
788 B
Django/Jinja
[Unit]
|
|
Description={{ container_name }} Podman Container
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=forking
|
|
TimeoutStartSec={{ systemd_TimeoutStartSec }}
|
|
ExecStartPre=-/usr/bin/podman pod rm -f {{ container_name }}
|
|
{% if container_run_as_user == 'root' %}
|
|
User={{ container_run_as_user }}
|
|
{% endif %}
|
|
RemainAfterExit=yes
|
|
|
|
ExecStart=/usr/bin/podman play kube {{ container_pod_yaml }}
|
|
|
|
ExecReload=-/usr/bin/podman pod stop {{ container_name }}
|
|
ExecReload=-/usr/bin/podman pod rm -f {{ container_name }}
|
|
ExecStop=-/usr/bin/podman pod rm -f {{ container_name }}
|
|
Restart={{ container_restart }}
|
|
RestartSec={{ systemd_RestartSec }}
|
|
|
|
[Install]
|
|
{% if container_run_as_user == 'root' %}
|
|
WantedBy=multi-user.target
|
|
{% endif %}
|
|
{% if container_run_as_user != 'root' %}
|
|
WantedBy=default.target
|
|
{% endif %}
|