config: add admin.sh wrapper script
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
bbdb294e3d
commit
a38d2c707a
|
@ -23,10 +23,14 @@
|
|||
with_fileglob:
|
||||
- 'templates/init/*.sql'
|
||||
|
||||
- name: 'Create compose file'
|
||||
- name: Install PostgreSQL client
|
||||
apt:
|
||||
name: 'postgresql-client'
|
||||
|
||||
- name: Create Admin wrapper script
|
||||
template:
|
||||
src: 'docker-compose.yml.j2'
|
||||
dest: '{{ postgres_ha_compose_file }}'
|
||||
owner: 'dockremap'
|
||||
src: 'scripts/admin.sh.j2'
|
||||
dest: '{{ postgres_ha_service_path }}/admin.sh'
|
||||
owner: 'root'
|
||||
group: 'docker'
|
||||
mode: 0644
|
||||
mode: 0750
|
||||
|
|
|
@ -1,4 +1,12 @@
|
|||
---
|
||||
- name: 'Create compose file'
|
||||
template:
|
||||
src: 'docker-compose.yml.j2'
|
||||
dest: '{{ postgres_ha_compose_file }}'
|
||||
owner: 'dockremap'
|
||||
group: 'docker'
|
||||
mode: 0644
|
||||
|
||||
- name: 'Create database container'
|
||||
docker_compose:
|
||||
project_src: '{{ postgres_ha_service_path }}'
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
# vim: set ft=sh:
|
||||
set -Eeo pipefail
|
||||
export PGPASSWORD='{{ postgres_ha_admin_pass }}'
|
||||
exec psql \
|
||||
--host='127.0.0.1' \
|
||||
--port='{{ postgres_ha_cont_port }}' \
|
||||
--username='{{ postgres_ha_admin_user }}' \
|
||||
--dbname='{{ postgres_ha_db_name }}' \
|
||||
${@}
|
Loading…
Reference in New Issue