diff options
author | Paul B <paul.bonaud@capitainetrain.com> | 2018-08-31 11:49:09 +0200 |
---|---|---|
committer | Paul B <paul.bonaud@capitainetrain.com> | 2018-08-31 12:00:24 +0200 |
commit | d0bc90e08c29e881c388c6803ed9c49dff1f1776 (patch) | |
tree | e5f633a7461f3d339ef89758fc7bb3f1b91563d3 /tasks/postgres-log-directory.yml | |
download | ansible-postgresql-role-1.0.0.tar.gz ansible-postgresql-role-1.0.0.tar.zst ansible-postgresql-role-1.0.0.zip |
Initial commit open sourcing Postgresql Ansible role1.0.0
Diffstat (limited to 'tasks/postgres-log-directory.yml')
-rw-r--r-- | tasks/postgres-log-directory.yml | 13 |
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 | ||