aboutsummaryrefslogblamecommitdiffhomepage
path: root/tasks/postgres-log-directory.yml
blob: df7ede04c88d4201855c2b7602abaabd78d2cba0 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                                                  
- name: Create dedicated log directory
  file: path={{ postgres_log_dir }} state=directory

- name: Check /var/log/postgresql
  stat: path=/var/log/postgresql
  register: var_log_postgresql

- name: Move /var/log/postgresql directory if not a link
  command: mv /var/log/postgresql /var/log/old-postgresql
  when: var_log_postgresql.stat.isdir is defined and var_log_postgresql.stat.isdir

- name: Create a symlink so regular log path points to dedicated log directory
  file: src={{ postgres_log_dir }} dest=/var/log/postgresql state=link