Add support for redis

This commit is contained in:
Waffles
2023-01-07 09:10:14 -08:00
parent 7ec729d912
commit ca4cac005d
5 changed files with 2293 additions and 9 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
---
REDIS_HOST: ''
REDIS_HOST: 'wooly.masto.yttrx.com'
# Host where cron jobs are run
MAINTENANCE_HOST: ''
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -49,8 +49,9 @@
path: /usr/local/bin/feeds-build.sh
mode: '0755'
- import_tasks: redis.yml
when: ansible_hostname == REDIS_HOST
- name: Configure redis
import_tasks: redis.yml
when: RUN_REDIS is defined and RUN_REDIS
- import_tasks: maintenance.yml
when: ansible_hostname == MAINTENANCE_HOST
+9 -5
View File
@@ -1,5 +1,9 @@
---
- name: Install redis server
package:
name: redis-server
state: present
- name: Set overcommit memory
sysctl:
name: vm.overcommit_memory
value: '1'
- name: Set redis.conf
copy:
dest: /home/mastodon/live/redis/redis.conf
src: redis.conf
@@ -27,9 +27,11 @@ services:
- 'DB_USER={{ ENV_PRODUCTION["DB_USER"] }}'
- 'DB_PASSWORD={{ ENV_PRODUCTION["DB_PASS"] }}'
- 'SERVER_TLS_SSLMODE=prefer'
{% if RUN_REDIS is defined %}
redis:
restart: always
image: redis:7-alpine
image: redis:7
command: redis-server /data/redis.conf
networks:
- internal_network
- external_network
@@ -39,6 +41,7 @@ services:
test: ['CMD', 'redis-cli', 'ping']
volumes:
- ./redis:/data
{% endif %}
networks:
external_network: