Skip to content

Commit

Permalink
Add sbs-redis container
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvanes committed Nov 3, 2023
1 parent 0644bc1 commit 30513ca
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion roles/docker_sbs/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sbs_dbbackup_user: "sbs_backupper"

sbs_migration_user: "sbs_migrater"

sbs_redis_host: "localhost"
sbs_redis_host: "redis"
sbs_redis_port: 6379
sbs_redis_ssl: false

Expand Down
11 changes: 11 additions & 0 deletions roles/docker_sbs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,17 @@
# changed_when: "'[alembic.runtime.migration] Running upgrade' in result.stderr"
# notify: "restart sbs"

- name: Create redis container
docker_container:
name: sbs-redis
image: redis:7
# restart_policy: "always"
# restart: true
state: started
# pull: true
networks:
- name: "traefik"

# We need to remove sram-static so it gets repopulated
# with new SBS image static content
- name: Stop and remove sbs and sbs-nginx containers
Expand Down
2 changes: 1 addition & 1 deletion roles/docker_sbs/templates/config.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ database:
permanent_session_lifetime: 1440

redis:
uri: "redis{% if sbs_redis_ssl %}s{% endif %}://:{{sbs_redis_password}}@{{sbs_redis_host}}:{{sbs_redis_port}}/"
uri: "redis://@{{sbs_redis_host}}/"

# add a per-release suffix here to invalidate sessions on new releases
secret_key: {{ sbs_db_secret }}{{sbs_secret_key_suffix}}
Expand Down
1 change: 1 addition & 0 deletions roles/docker_sbs/templates/sbs-nginx.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ events {
}

http {
include /etc/nginx/mime.types;
server {
listen 80;
http2 on;
Expand Down

0 comments on commit 30513ca

Please sign in to comment.