-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.yml
38 lines (35 loc) · 1.17 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
# ansible vars
postgres_data_dir: "{{ home_dir }}/data/postgres"
container_name: "{{ container_name | default('postgres') }}"
# directories
service_data_dir: "{{ postgres_data_dir }}"
service_directories:
- "{{ postgres_data_dir }}"
- "{{ postgres_data_dir }}/db-data"
# docker config
service_config:
home_dir: "{{ home_dir }}"
name: "{{ container_name }}"
port: 5432
remove_volumes: "{{ remove_volumes }}"
postgres_version: "latest"
environment:
POSTGRES_DB: "cluster"
POSTGRES_USER: "{{ vault_postgres_user | default('postgres') }}"
POSTGRES_PASSWORD: "{{ vault_postgres_password | default('changeme') }}"
ip_address: "172.20.0.2"
configs:
max_connections: 200
shared_buffers: 2GB
effective_cache_size: 6GB
# templates
config_templates:
- src: "../../templates/postgres/postgres.conf"
dest: "{{ postgres_data_dir }}/postgres.conf"
- src: "../../templates/postgres/pg_hba.conf"
dest: "{{ postgres_data_dir }}/pg_hba.conf"
- src: "../../templates/postgres/docker-compose.yml"
dest: "{{ postgres_data_dir }}/docker-compose.yml"
- src: "../../files/postgres/init.sql"
dest: "{{ postgres_data_dir }}/docker_postgres_init.sql"