create required directories

This commit is contained in:
Robert Kaussow 2018-07-07 16:49:14 +02:00
parent 9a716d6625
commit e373d9f052
2 changed files with 11 additions and 5 deletions

View File

@ -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

View File

@ -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: