diff options
Diffstat (limited to 'tasks/postgres-data-directory.yml')
-rw-r--r-- | tasks/postgres-data-directory.yml | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tasks/postgres-data-directory.yml b/tasks/postgres-data-directory.yml new file mode 100644 index 0000000..02b6df8 --- /dev/null +++ b/tasks/postgres-data-directory.yml | |||
@@ -0,0 +1,10 @@ | |||
1 | - name: Create dedicated data directory | ||
2 | file: path={{ postgres_data_dir }} state=directory owner=postgres group=postgres | ||
3 | |||
4 | - name: Check /var/lib/postgresql directory | ||
5 | stat: path=/var/lib/postgresql/ | ||
6 | register: var_lib_postgresql | ||
7 | |||
8 | - name: Create a symlink between regular data directory and dedicated one | ||
9 | file: src={{ postgres_data_dir }} dest=/var/lib/postgresql state=link | ||
10 | when: not var_lib_postgresql.stat.exists | ||