blob: 8d5180ae36b773732ecbf3c7729c5fedd0a0947b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
---
- name: create mongodb data directory
file:
name: /srv/mongodb
state: directory
- name: create bind mount for mongodb
mount:
src: /srv/mongodb
path: /var/lib/mongodb
fstype: none
opts: bind,defaults
state: mounted
- name: install mongodb server
apt:
name:
- mongodb
- mongo-tools
- python-pymongo
state: present
# - name: check if admin user already exists
# command: >
# mongo --quiet -u root -p {{ liquidtruth_root_password }} --eval 'db.version()' admin
# register: mongodb_root_user_check
# changed_when: false
# check_mode: no
# ignore_errors: true
# no_log: true
# - name: initialize authorization
# include_tasks: mongodb_authorization.yml
# when: mongodb_root_user_check
|