From e373d9f0522c062070815dd3cc0ce2d96cde0b5b Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sat, 7 Jul 2018 16:49:14 +0200 Subject: [PATCH] create required directories --- defaults/main.yml | 10 +++++++--- tasks/install.yml | 6 ++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 3483bd6..add4518 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,8 +2,12 @@ mongodb_version: 3.6 mongodb_system_user: mongod mongodb_system_group: mongod -mongodb_storage_dbpath: /var/lib/mongo - - # mongodb_system_gid: omit # mongodb_system_uid: omit + +mongodb_storage_dbpath: /var/lib/mongo +mongodb_storage_journal_enabled: True + +mongodb_systemlog_destination: syslog +mongodb_systemlog_logappend: True +mongodb_systemlog_path: /var/log/mongodb/mongod.log diff --git a/tasks/install.yml b/tasks/install.yml index 80852bb..00d770e 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -29,12 +29,14 @@ - name: Create db storage dir at '{{ mongodb_storage_dbpath }}' file: - path: "{{ mongodb_storage_dbpath }}" + path: "{{ item }}" owner: "{{ mongodb_system_user }}" group: "{{ mongodb_system_group }}" - follow: yes recurse: yes state: directory + with_items: + - "{{ mongodb_storage_dbpath }}" + - "{{ mongodb_systemlog_path | dirname if mongodb_systemlog_destination == 'file'}}" # - name: Make sure mongodb is running # systemd: