aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks/postgres-log-directory.yml
diff options
context:
space:
mode:
Diffstat (limited to 'tasks/postgres-log-directory.yml')
-rw-r--r--tasks/postgres-log-directory.yml13
1 files changed, 13 insertions, 0 deletions
diff --git a/tasks/postgres-log-directory.yml b/tasks/postgres-log-directory.yml
new file mode 100644
index 0000000..df7ede0
--- /dev/null
+++ b/tasks/postgres-log-directory.yml
@@ -0,0 +1,13 @@
1- name: Create dedicated log directory
2 file: path={{ postgres_log_dir }} state=directory
3
4- name: Check /var/log/postgresql
5 stat: path=/var/log/postgresql
6 register: var_log_postgresql
7
8- name: Move /var/log/postgresql directory if not a link
9 command: mv /var/log/postgresql /var/log/old-postgresql
10 when: var_log_postgresql.stat.isdir is defined and var_log_postgresql.stat.isdir
11
12- name: Create a symlink so regular log path points to dedicated log directory
13 file: src={{ postgres_log_dir }} dest=/var/log/postgresql state=link