Skip to content

Commit 4623063

Browse files
author
Sergei Antipov
committed
Fixed logfile creation
1 parent 11c4200 commit 4623063

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tasks/configure.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@
6363
- name: Create log dir if missing
6464
file: state=directory recurse=yes dest={{ mongodb_conf_logpath|dirname }} owner={{ mongodb_user }} group={{mongodb_user}} mode=0755
6565

66+
- name: Check than logfile exists
67+
stat: path={{ mongodb_conf_logpath }}
68+
register: logfile_stat
69+
6670
- name: Create log if missing
6771
file: state=touch dest={{ mongodb_conf_logpath }} owner={{ mongodb_user }} group={{mongodb_user}} mode=0755
68-
69-
- name: Configure log file
70-
file: state=file path={{ mongodb_conf_logpath }} owner={{mongodb_user}} group={{mongodb_user}} mode=0755
72+
when: logfile_stat is defined and not logfile_stat.stat.exists
7173

7274
- name: Configure mongodb
7375
template: src=mongod.conf.j2 dest=/etc/mongod.conf backup=yes owner=root group=root mode=0644

0 commit comments

Comments
 (0)