Merge pull request #405 from rasdani/main

Added Redis and Redis Insight to Ansible playbook.
This commit is contained in:
Yannic Kilcher
2023-01-09 08:11:22 +01:00
committed by GitHub
4 changed files with 45 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
To test the ansible playbook on localhost run
`ansible-playbook -i test.inventory.ini dev.yaml`.\
In case you're missing the ansible docker depencency install it with `ansible-galaxy collection install community.docker`.\
Point Redis Insights to the Redis database by visiting localhost:8001 in a
browser and select "I already have a database" followed by "Connect to a Redis
Database".\
For host, port and name fill in `oasst-redis`, `6379` and `redis`.
+34
View File
@@ -10,6 +10,39 @@
state: present
driver: bridge
- name: Copy redis.conf to managed node
ansible.builtin.copy:
src: ./redis.conf
dest: ./redis.conf
- name: Set up Redis
community.docker.docker_container:
name: oasst-redis
image: redis
state: started
restart_policy: always
network_mode: oasst
ports:
- 6379:6379
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 2s
timeout: 2s
retries: 10
command: redis-server /usr/local/etc/redis/redis.conf
volumes:
- "./redis.conf:/usr/local/etc/redis/redis.conf"
- name: Set up Redis Insights
community.docker.docker_container:
name: oasst-redis-insights
image: redislabs/redisinsight:latest
state: started
restart_policy: always
network_mode: oasst
ports:
- 8001:8001
- name: Create postgres containers
community.docker.docker_container:
name: "{{ item.name }}"
@@ -51,6 +84,7 @@
network_mode: oasst
env:
POSTGRES_HOST: oasst-postgres
REDIS_HOST: oasst-redis
DEBUG_ALLOW_ANY_API_KEY: "true"
DEBUG_USE_SEED_DATA: "true"
MAX_WORKERS: "1"
+2
View File
@@ -0,0 +1,2 @@
maxmemory 100mb
maxmemory-policy allkeys-lru
+2
View File
@@ -0,0 +1,2 @@
[test]
dev ansible_connection=local