xoxys.redis/templates/etc/containers/systemd/redis.container.j2
Robert Kaussow 2c2b3f789c
Some checks failed
continuous-integration/drone/pr Build is failing
use dedicated systemd env file
2023-08-05 23:49:35 +02:00

39 lines
951 B
Django/Jinja

#jinja2: lstrip_blocks: True
{{ ansible_managed | comment }}
[Install]
WantedBy=default.target
[Service]
Restart=on-failure
RestartSec=5s
EnvironmentFile=/etc/containers/systemd/redis.sys.env
ExecReload=/usr/bin/podman kill --signal=SIGHUP %p
[Container]
Image={{ redis_image }}
Exec=redis-server $REDIS_ARGS
EnvironmentFile=/etc/containers/systemd/redis.env
User=999
Group=999
{% for item in redis_volumes %}
Volume={{ item.name }}:{{ item.dest }}{{ ":" + item.opts if item.opts is defined else "" }}
{% endfor %}
{% if (redis_cap_add + redis_cap_drop) | length > 0 %}
{% if redis_cap_add | length > 0 %}
AddCapability={{ redis_cap_add | join(" ") }}
{% endif %}
{% if redis_cap_drop | length > 0 %}
DropCapability={{ redis_cap_drop | join(" ") }}
{% endif %}
{% endif %}
Network={{ redis_network }}
{% for item in redis_exposed_ports %}
PublishPort={{ item }}
{% endfor %}
{% for item in redis_podman_args %}
PodmanArgs={{ item }}
{% endfor %}