2023-08-05 15:53:22 +00:00
|
|
|
#jinja2: lstrip_blocks: True
|
|
|
|
{{ ansible_managed | comment }}
|
|
|
|
[Install]
|
|
|
|
WantedBy=default.target
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Restart=on-failure
|
|
|
|
RestartSec=5s
|
|
|
|
|
2023-08-05 21:49:35 +00:00
|
|
|
EnvironmentFile=/etc/containers/systemd/redis.sys.env
|
2023-08-05 15:53:22 +00:00
|
|
|
ExecReload=/usr/bin/podman kill --signal=SIGHUP %p
|
|
|
|
|
|
|
|
[Container]
|
|
|
|
Image={{ redis_image }}
|
|
|
|
Exec=redis-server $REDIS_ARGS
|
2023-08-05 21:49:35 +00:00
|
|
|
EnvironmentFile=/etc/containers/systemd/redis.env
|
2023-08-05 15:53:22 +00:00
|
|
|
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 %}
|