19 lines
887 B
YAML
19 lines
887 B
YAML
name: postgresql
|
|
user: postgres
|
|
command: /usr/bin/postgres -D /srv/%{ENVIRONMENT}/postgresql -k /tmp/postgresql-%{ENVIRONMENT}
|
|
#stop-command: kill -HUP %{PID}
|
|
environment-variables:
|
|
- PGROOT=/srv/%{ENVIRONMENT}/postgresql
|
|
checks:
|
|
- name: database directory creation
|
|
directory: /srv/%{ENVIRONMENT}/postgresql
|
|
command: mkdir -p /srv/%{ENVIRONMENT}/postgresql && chown postgres:postgres /srv/%{ENVIRONMENT}/postgresql
|
|
- name: database creation
|
|
file: /srv/%{ENVIRONMENT}/postgresql/base
|
|
command: su - postgres -c "initdb --locale en_US.UTF-8 -D '/srv/%{ENVIRONMENT}/postgresql'"
|
|
- name: sockets directory
|
|
directory: /tmp/postgres-%{ENVIRONMENT}
|
|
# FIXME: impose permissions
|
|
command: mkdir -p /tmp/postgresql-%{ENVIRONMENT} && chown postgres:postgres /tmp/postgresql-%{ENVIRONMENT}
|
|
# FIXME: add postgresql-check-db-dir around here
|