mirror of
https://github.com/status-im/infra-role-postgres-ha.git
synced 2025-02-23 03:48:20 +00:00
37 lines
892 B
YAML
37 lines
892 B
YAML
---
|
|
- name: 'Create service and container folders'
|
|
file:
|
|
dest: '{{ item }}'
|
|
state: 'directory'
|
|
owner: 'dockremap'
|
|
group: 'docker'
|
|
mode: 0775
|
|
with_items:
|
|
- '{{ postgres_ha_service_path }}'
|
|
- '{{ postgres_ha_cont_data_vol }}'
|
|
- '{{ postgres_ha_cont_init_vol }}'
|
|
- '{{ postgres_ha_cont_backup_vol }}'
|
|
|
|
- name: Create dbinit SQL files
|
|
when: postgres_ha_is_master
|
|
template:
|
|
src: '{{ item }}'
|
|
dest: '{{ postgres_ha_cont_init_vol }}/{{ item | basename }}'
|
|
owner: '{{ postgres_ha_host_uid }}'
|
|
group: 'dockremap'
|
|
mode: 0640
|
|
with_fileglob:
|
|
- 'templates/init/*.sql'
|
|
|
|
- name: Install PostgreSQL client
|
|
apt:
|
|
name: 'postgresql-client'
|
|
|
|
- name: Create Admin wrapper script
|
|
template:
|
|
src: 'scripts/admin.sh.j2'
|
|
dest: '{{ postgres_ha_service_path }}/admin.sh'
|
|
owner: 'root'
|
|
group: 'docker'
|
|
mode: 0750
|