This commit is contained in:
parent
3bebe077a8
commit
2c2b3f789c
@ -44,7 +44,7 @@ redis_podman_args:
|
||||
- --health-retries=6
|
||||
- --health-on-failure=kill
|
||||
|
||||
redis_loglevel: "notice"
|
||||
redis_log_level: "notice"
|
||||
|
||||
redis_timeout: 300
|
||||
redis_databases: 16
|
||||
|
@ -25,13 +25,16 @@
|
||||
set_fact:
|
||||
__redis_volumes_map: "{{ __redis_volumes_raw.results | json_query('[].volume') | items2dict(key_name='Name', value_name='Mountpoint') }}"
|
||||
|
||||
- name: Deploy redis env file
|
||||
- name: Deploy redis env files
|
||||
template:
|
||||
src: etc/containers/systemd/redis.env.j2
|
||||
dest: "/etc/containers/systemd/redis.env"
|
||||
src: "etc/containers/systemd/{{ item }}.j2"
|
||||
dest: "/etc/containers/systemd/{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0640"
|
||||
loop:
|
||||
- redis.env
|
||||
- redis.sys.env
|
||||
notify: __redis_restart
|
||||
|
||||
- name: Create container specs
|
||||
|
@ -7,12 +7,13 @@ WantedBy=default.target
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
EnvironmentFile=/etc/containers/systemd/redis.env
|
||||
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 %}
|
||||
|
@ -1,17 +1,2 @@
|
||||
#jinja2: lstrip_blocks: True
|
||||
{{ ansible_managed | comment }}
|
||||
REDIS_ARGS=--timeout {{ redis_timeout }} --loglevel {{ redis_loglevel }} --databases {{ redis_databases }} \
|
||||
{% for save in redis_save %}
|
||||
--save '{{ save }}'\
|
||||
{% endfor %}
|
||||
--rdbcompression {{ redis_rdbcompression | bool | ternary("yes", "no") }} \
|
||||
--appendonly {{ redis_appendonly | bool | ternary("yes", "no") }} \
|
||||
--appendfsync {{ redis_appendfsync }} \
|
||||
--no-appendfsync-on-rewrite no \
|
||||
{% if redis_requirepass is defined %}
|
||||
--requirepass {{ redis_requirepass }} \
|
||||
{% endif %}
|
||||
{% for command in redis_disabled_commands %}
|
||||
--rename-command '{{ command }} ""' \
|
||||
{% endfor %}
|
||||
--port 6379
|
||||
|
17
templates/etc/containers/systemd/redis.env.sys.j2
Normal file
17
templates/etc/containers/systemd/redis.env.sys.j2
Normal file
@ -0,0 +1,17 @@
|
||||
#jinja2: lstrip_blocks: True
|
||||
{{ ansible_managed | comment }}
|
||||
REDIS_ARGS=--timeout {{ redis_timeout }} --loglevel {{ redis_log_level }} --databases {{ redis_databases }} \
|
||||
{% for save in redis_save %}
|
||||
--save '{{ save }}'\
|
||||
{% endfor %}
|
||||
--rdbcompression {{ redis_rdbcompression | bool | ternary("yes", "no") }} \
|
||||
--appendonly {{ redis_appendonly | bool | ternary("yes", "no") }} \
|
||||
--appendfsync {{ redis_appendfsync }} \
|
||||
--no-appendfsync-on-rewrite no \
|
||||
{% if redis_requirepass is defined %}
|
||||
--requirepass {{ redis_requirepass }} \
|
||||
{% endif %}
|
||||
{% for command in redis_disabled_commands %}
|
||||
--rename-command '{{ command }} ""' \
|
||||
{% endfor %}
|
||||
--port 6379
|
Loading…
Reference in New Issue
Block a user