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: