diff --git a/bundles/pretalx/files/pretalx.cfg b/bundles/pretalx/files/pretalx.cfg index 517e02a..602c518 100644 --- a/bundles/pretalx/files/pretalx.cfg +++ b/bundles/pretalx/files/pretalx.cfg @@ -22,3 +22,13 @@ user = password = tls = False ssl = False + +% if node.has_bundle('redis'): +[celery] +backend = redis://127.0.0.1/1 +broker = redis://127.0.0.1/2 + +[redis] +location = redis://@127.0.0.1:6379/3 +session = True +% endif diff --git a/bundles/redis/files/redis.conf b/bundles/redis/files/redis.conf new file mode 100644 index 0000000..0d16d71 --- /dev/null +++ b/bundles/redis/files/redis.conf @@ -0,0 +1,50 @@ +activerehashing yes +aof-load-truncated yes +aof-rewrite-incremental-fsync yes +appendfilename "appendonly.aof" +appendfsync everysec +appendonly ${node.metadata.get('redis', {}).get('appendonly', "no")} +auto-aof-rewrite-min-size 64mb +auto-aof-rewrite-percentage 100 +bind ${node.metadata.get('redis', {}).get('bind', "127.0.0.1")} +client-output-buffer-limit normal 0 0 0 +client-output-buffer-limit pubsub 32mb 8mb 60 +client-output-buffer-limit slave 256mb 64mb 60 +daemonize yes +databases 16 +dbfilename dump.rdb +dir /var/lib/redis +hash-max-ziplist-entries 512 +hash-max-ziplist-value 64 +hll-sparse-max-bytes 3000 +hz 10 +latency-monitor-threshold 0 +list-max-ziplist-entries 512 +list-max-ziplist-value 64 +logfile /var/log/redis/redis-server.log +loglevel notice +lua-time-limit 5000 +no-appendfsync-on-rewrite no +notify-keyspace-events "" +pidfile /var/run/redis/redis-server.pid +port 6379 +rdbchecksum yes +rdbcompression yes +repl-disable-tcp-nodelay no +repl-diskless-sync no +repl-diskless-sync-delay 5 +save 300 10 +save 60 10000 +save 900 1 +set-max-intset-entries 512 +slave-priority 100 +slave-read-only yes +slave-serve-stale-data yes +slowlog-log-slower-than 10000 +slowlog-max-len 128 +stop-writes-on-bgsave-error yes +tcp-backlog 511 +tcp-keepalive 0 +timeout 0 +zset-max-ziplist-entries 128 +zset-max-ziplist-value 64 diff --git a/bundles/redis/items.py b/bundles/redis/items.py new file mode 100644 index 0000000..b68e28b --- /dev/null +++ b/bundles/redis/items.py @@ -0,0 +1,22 @@ +svc_systemd = { + 'redis-server': { + 'needs': { + 'file:/etc/redis/redis.conf', + }, + }, +} + +files = { + '/etc/redis/redis.conf': { + 'content_type': 'mako', + 'mode': '0640', + 'owner': 'redis', + 'group': 'redis', + 'needs': { + 'pkg_apt:redis-server', + }, + 'triggers': { + 'svc_systemd:redis-server:restart', + }, + }, +} diff --git a/bundles/redis/metadata.py b/bundles/redis/metadata.py new file mode 100644 index 0000000..3a976be --- /dev/null +++ b/bundles/redis/metadata.py @@ -0,0 +1,21 @@ +defaults = { + 'apt': { + 'packages': { + 'redis-server': {}, + }, + }, + 'backups': { + 'paths': { + '/var/lib/redis', + }, + }, + 'icinga2_api': { + 'redis': { + 'services': { + 'REDIS PROCESS': { + 'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -C redis-server -c 1:', + }, + } + }, + }, +} diff --git a/nodes/voc/pretalx.py b/nodes/voc/pretalx.py index 00f032b..20918df 100644 --- a/nodes/voc/pretalx.py +++ b/nodes/voc/pretalx.py @@ -10,6 +10,7 @@ nodes['voc.pretalx'] = { 'pretalx', 'postfix', 'postgresql', + 'redis', 'sshmon', }, 'metadata': {