diff --git a/ansible/inventory/group_vars/all.yaml b/ansible/inventory/group_vars/all.yaml index 162ad18..ae5650c 100644 --- a/ansible/inventory/group_vars/all.yaml +++ b/ansible/inventory/group_vars/all.yaml @@ -75,3 +75,4 @@ version: # App vaultwarden: "1.35.4" gitea: "1.25.5" + redis: "8.6.1" diff --git a/config/services/containers/app/redis/redis.conf.j2 b/config/services/containers/app/redis/redis.conf.j2 new file mode 100644 index 0000000..2895939 --- /dev/null +++ b/config/services/containers/app/redis/redis.conf.j2 @@ -0,0 +1,4 @@ +databases 16 +bind 0.0.0.0 +port {{ hostvars['app']['redis'][redis_service] }} +protected-mode no diff --git a/config/services/containers/app/redis/redis.container.j2 b/config/services/containers/app/redis/redis.container.j2 new file mode 100644 index 0000000..77edd00 --- /dev/null +++ b/config/services/containers/app/redis/redis.container.j2 @@ -0,0 +1,31 @@ +[Quadlet] +DefaultDependencies=false + +[Unit] +Description=Redis - {{ redis_service }} + +After=network-online.target +Wants=network-online.target + +[Container] +Image=docker.io/library/redis:{{ version['containers']['redis'] }} + +ContainerName=redis_{{ redis_service }} +HostName=redis_{{ redis_service }} + +PublishPort={{ hostvars['app']['redis'][redis_service] }}:{{ hostvars['app']['redis'][redis_service] }} + +Volume=%h/containers/redis/{{ redis_service }}/data:/data:rw +Volume=%h/containers/redis/{{ redis_service }}/redis.conf:/usr/local/etc/redis/redis.conf:ro + +Exec=redis-server /usr/local/etc/redis/redis.conf + +Environment="TZ=Asia/Seoul" + +[Service] +Restart=always +RestartSec=10s +TimeoutStopSec=120 + +[Install] +WantedBy=default.target