Jakub Sokołowski a38d2c707a
config: add admin.sh wrapper script
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-11-21 16:21:34 +01:00

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