Ensure Postgres data ownership is correct

Fixes #257 (Github Issue)
This commit is contained in:
Slavi Pantaleev 2019-09-02 10:01:31 +03:00
parent 801658f90a
commit 1784bde226

View File

@ -44,6 +44,18 @@
- "{{ matrix_postgres_data_path }}" - "{{ matrix_postgres_data_path }}"
when: matrix_postgres_enabled|bool when: matrix_postgres_enabled|bool
# We do this as a separate task, because:
# - we'd like to do it for the data path only, not for the base path (which contains root-owned environment variable files we'd like to leave as-is)
# - we need to do it without `mode`, or we risk making certain `.conf` and other files's executable bit to flip to true
- name: Ensure Postgres data path ownership is correct
file:
path: "{{ matrix_postgres_data_path }}"
state: directory
owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_username }}"
recurse: yes
when: matrix_postgres_enabled|bool
- name: Ensure Postgres environment variables file created - name: Ensure Postgres environment variables file created
template: template:
src: "{{ role_path }}/templates/{{ item }}.j2" src: "{{ role_path }}/templates/{{ item }}.j2"