infra-role-postgres-ha/tasks/config.yml

40 lines
974 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
register: postgres_ha_init_files
with_fileglob:
- 'templates/init/*.sql'
- name: Install PostgreSQL client
apt:
name: 'postgresql-client'
- name: Create wrapper scripts
template:
src: '{{ item }}'
dest: '{{ postgres_ha_service_path }}/{{ item | basename }}'
owner: 'root'
group: 'docker'
mode: 0750
with_fileglob:
- 'templates/scripts/*.sh'