You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
932 B
26 lines
932 B
---
|
|
# This playbook deploys the mongodb configurationdb servers
|
|
|
|
- name: Create data directory for mongoc configuration server
|
|
file: path={{ mongodb_datadir_prefix }}/configdb state=directory owner=mongod group=mongod
|
|
|
|
- name: Create the mongo configuration server startup file
|
|
template: src=mongoc.j2 dest=/etc/init.d/mongoc mode=0655
|
|
|
|
|
|
- name: Create the mongo configuration server file
|
|
template: src=mongoc.conf.j2 dest=/etc/mongoc.conf
|
|
|
|
|
|
- name: Copy the keyfile for authentication
|
|
copy: src=roles/mongod/files/secret dest={{ mongodb_datadir_prefix }}/secret owner=mongod group=mongod mode=0400
|
|
|
|
- name: Start the mongo configuration server service
|
|
command: creates=/var/lock/subsys/mongoc /etc/init.d/mongoc start
|
|
|
|
- name: pause
|
|
pause: seconds=20
|
|
|
|
- name: add the admin user
|
|
mongodb_user: database=admin name=admin password={{ mongo_admin_pass }} login_port={{ mongoc_port }} state=present
|
|
ignore_errors: yes
|
|
|