Merge pull request #91 from exponov/master

fix MongoDB example
pull/63/head
Brian Coca 9 years ago
commit b1e5b3990f
  1. 2
      mongodb/README.md
  2. 4
      mongodb/hosts
  3. 2
      mongodb/roles/mongoc/templates/mongoc.conf.j2
  4. 9
      mongodb/roles/mongod/tasks/main.yml
  5. 2
      mongodb/roles/mongod/templates/mongod.conf.j2

@ -104,9 +104,9 @@ The inventory file looks as follows:
#The list of servers where replication should happen, including the master server.
[replication_servers]
mongo3
mongo1
mongo2
mongo3
#The list of mongodb configuration servers, make sure it is 1 or 3
[mongoc_servers]

@ -9,10 +9,10 @@ mongo4 mongod_port=2703
#The list of servers where replication should happen, by default include all servers
[replication_servers]
mongo4
mongo3
mongo1
mongo2
mongo3
mongo4
#The list of mongodb configuration servers, make sure it is 1 or 3
[mongoc_servers]

@ -12,6 +12,6 @@ port = {{ mongoc_port }}
dbpath={{ mongodb_datadir_prefix }}configdb
keyFile={{ mongodb_datadir_prefix }}secret
# location of pidfile
pidfilepath = /var/run/mongoc.pid
pidfilepath = /var/run/mongo/mongoc.pid
configsvr=true

@ -6,7 +6,12 @@
delegate_to: '{{ item }}'
with_items: groups.replication_servers
- name: create data directory for mongodb
file: path=/var/log/mongo state=directory owner=mongod group=mongod
- name: create data directory for mongodb
file: path=/var/run/mongo state=directory owner=mongod group=mongod
- name: Create the mongodb startup file
template: src=mongod.j2 dest=/etc/init.d/mongod-{{ inventory_hostname }} mode=0655
delegate_to: '{{ item }}'
@ -34,4 +39,4 @@
pause: seconds=20
- name: Initialize the replication set
shell: /usr/bin/mongo --port "{{ mongod_port }}" /tmp/repset_init.js
shell: /usr/bin/mongo --port "{{ mongod_port }}" /tmp/repset_init.js

@ -15,7 +15,7 @@ dbpath={{ mongodb_datadir_prefix }}mongo-{{ inventory_hostname }}
keyFile={{ mongodb_datadir_prefix }}/secret
# location of pidfile
pidfilepath = /var/run/mongod.pid
pidfilepath = /var/run/mongo/mongod-{{ inventory_hostname }}.pid
# Ping interval for Mongo monitoring server.