Skip to content

Commit a0ce9ba

Browse files
committed
Ensure dbpath directory has configurable owner
Looks like when this variable was introduced, this particular task was missed. This has also been moved to the configuration stage, since it seems to fit with the task for ensuring the log directory exists, too.
1 parent 707d0ec commit a0ce9ba

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

tasks/configure.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@
3232
file: state=touch dest={{ mongodb_systemlog_path }} owner={{ mongodb_user }} group={{mongodb_user}} mode=0755
3333
when: logfile_stat is defined and not logfile_stat.stat.exists
3434

35+
- name: Ensure dbpath directory
36+
file:
37+
path: "{{ mongodb_storage_dbpath }}"
38+
state: directory
39+
owner: "{{ mongodb_user }}"
40+
recurse: yes
41+
3542
- name: Configure mongodb
3643
template: src=mongod.conf.j2 dest=/etc/mongod.conf backup=yes owner=root group=root mode=0644
3744
register: config_result

tasks/install.deb.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@
4444
- "{{mongodb_package}}"
4545
- numactl
4646

47-
- name: Ensure dbpath directory
48-
file: path={{mongodb_storage_dbpath}} state=directory owner=mongodb recurse=yes
49-
5047
- name: reload systemd
5148
shell: systemctl daemon-reload
5249
changed_when: false

0 commit comments

Comments
 (0)