This repository has been archived on 2020-08-22. You can view files and clone it, but cannot push or open issues or pull requests.
ansible/backend.yml
2020-07-12 18:34:42 +02:00

57 lines
2.2 KiB
YAML

---
- hosts: backend
vars:
apt:
packages:
- { package: "postgresql", state: present }
- { package: "python3-psycopg2", state: present }
- { package: "redis", state: present }
- { package: "influxdb", state: present }
systemd:
services:
- { name: "postgresql@{{ postgres.version }}-main", enabled: true, action: reloaded }
- { name: "redis-server", enabled: true, action: restarted }
- { name: "influxdb", enabled: true, action: restarted }
overrides:
- "influxdb"
- "postgresql@"
- "redis-server"
postgres:
host: "{{ global.backend.postgres.host }}"
port: "{{ global.backend.postgres.port }}"
version: "12"
# NOTE: If something fails due to the following statement make sure
# the volume is mounted and the ansible cache is cleared!
data:
path: "/dbs/postgres"
#uuid: '28464b32-32f4-42e4-9625-1dddfb65e1a9'
databases:
- grafana
- pleroma
- gitea
- murmur
redis:
host: "{{ global.backend.redis.host }}"
port: "{{ global.backend.redis.port }}"
data:
#uuid: '1245e7d9-1054-4e2f-816a-d38efbb47589'
path: "/dbs/redis"
influxdb:
data:
path: "/var/lib/influxdb"
uuid: "ac0740fe-abab-4bda-84ef-e39e0bd823b3"
port: "{{ global.backend.influxdb.port }}"
vault:
roles:
- "postgresql"
mounts:
- { uuid: '{{ influxdb.data.uuid }}', dest: '{{ influxdb.data.path }}', state: 'mounted', fstype: 'ext4' }
roles:
- vault
- mounts
- apt
- postgresql
- influxdb
- redis
- systemd