39 lines
989 B
Django/Jinja
39 lines
989 B
Django/Jinja
#jinja2: lstrip_blocks: True
|
|
{{ ansible_managed | comment }}
|
|
[Install]
|
|
WantedBy=default.target
|
|
|
|
[Service]
|
|
Restart=on-failure
|
|
RestartSec=5s
|
|
|
|
EnvironmentFile=/etc/containers/systemd/postgres.sys.env
|
|
ExecReload=/usr/bin/podman kill --signal=SIGHUP %p
|
|
|
|
[Container]
|
|
Image={{ postgres_image }}
|
|
Exec=postgres $POSTGRES_ARGS
|
|
EnvironmentFile=/etc/containers/systemd/postgres.env
|
|
User=999
|
|
Group=999
|
|
{% for item in postgres_volumes %}
|
|
Volume={{ item.name }}:{{ item.dest }}{{ ":" + item.opts if item.opts is defined else "" }}
|
|
{% endfor %}
|
|
{% if (postgres_cap_add + postgres_cap_drop) | length > 0 %}
|
|
|
|
{% if postgres_cap_add | length > 0 %}
|
|
AddCapability={{ postgres_cap_add | join(" ") }}
|
|
{% endif %}
|
|
{% if postgres_cap_drop | length > 0 %}
|
|
DropCapability={{ postgres_cap_drop | join(" ") }}
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
Network={{ postgres_network }}
|
|
{% for item in postgres_exposed_ports %}
|
|
PublishPort={{ item }}
|
|
{% endfor %}
|
|
{% for item in postgres_podman_args %}
|
|
PodmanArgs={{ item }}
|
|
{% endfor %}
|