From a0ce9baaac0b4f45995df781b5534114e8639b2f Mon Sep 17 00:00:00 2001 From: Daniel White Date: Wed, 27 Apr 2016 14:14:55 +1000 Subject: [PATCH] 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. --- tasks/configure.yml | 7 +++++++ tasks/install.deb.yml | 3 --- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tasks/configure.yml b/tasks/configure.yml index 2604b4b..80678f6 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -32,6 +32,13 @@ file: state=touch dest={{ mongodb_systemlog_path }} owner={{ mongodb_user }} group={{mongodb_user}} mode=0755 when: logfile_stat is defined and not logfile_stat.stat.exists +- name: Ensure dbpath directory + file: + path: "{{ mongodb_storage_dbpath }}" + state: directory + owner: "{{ mongodb_user }}" + recurse: yes + - name: Configure mongodb template: src=mongod.conf.j2 dest=/etc/mongod.conf backup=yes owner=root group=root mode=0644 register: config_result diff --git a/tasks/install.deb.yml b/tasks/install.deb.yml index ddd6e4c..fc7ed64 100644 --- a/tasks/install.deb.yml +++ b/tasks/install.deb.yml @@ -44,9 +44,6 @@ - "{{mongodb_package}}" - numactl -- name: Ensure dbpath directory - file: path={{mongodb_storage_dbpath}} state=directory owner=mongodb recurse=yes - - name: reload systemd shell: systemctl daemon-reload changed_when: false