Commit 73f68f37 by Feanil Patel

Update to use cluster enabling vars in both rabbit and mongo.

parent dc073224
......@@ -9,6 +9,8 @@ mongo_cluster_members:
mongo_data_dir: "{{ COMMON_DATA_DIR }}/mongo"
mongo_log_dir: "{{ COMMON_LOG_DIR }}/mongo"
mongo_user: mongodb
# Vars Meant to be overridden
MONGO_USERS:
- user: cs_comments_service
password: password
......@@ -17,5 +19,9 @@ MONGO_USERS:
password: password
database: edxapp
MONGO_CLUSTERED: !!null
##
mongo_logpath: "{{ mongo_log_dir }}/mongodb.log"
mongo_dbpath: "{{ mongo_data_dir }}/mongodb"
......@@ -46,7 +46,7 @@
mode=0600
owner=mongodb
group=mongodb
when: mongo_clustered is defined
when: MONGO_CLUSTERED is defined
- name: mongo | copy configuration template
template: src=mongodb.conf.j2 dest=/etc/mongodb.conf backup=yes
......@@ -60,11 +60,11 @@
- name: mongo | Create the file to initialize the mongod replica set
template: src=repset_init.j2 dest=/tmp/repset_init.js
when: mongo_clustered is defined
when: MONGO_CLUSTERED is defined
- name: mongo | Initialize the replication set
shell: /usr/bin/mongo /tmp/repset_init.js
when: mongo_clusterd is defined
when: MONGO_CLUSTERED is defined
# Ignoring errors here because slave instances will fail this command
# since slaveOk is false in ansible 1.3.
......
......@@ -15,7 +15,7 @@ bind_ip = {{ mongo_bind_ip }}
# Enable journaling, http://www.mongodb.org/display/DOCS/Journaling
journal=true
{% if mongo_clustered is defined %}
{% if MONGO_CLUSTERED is defined %}
keyFile = {{ mongo_key_file }}
replSet = {{ mongo_repl_set }}
{% endif %}
......
......@@ -26,6 +26,8 @@ RABBIT_USERS:
- name: 'celery'
password: 'celery'
RABBITMQ_CLUSTERED: !!null
# Structure for auth config file.
rabbitmq_auth_config:
erlang_cookie: $RABBIT_ERLANG_COOKIE
......
......@@ -2,7 +2,7 @@
and also a rabbitmq machine.
#}
{%- if rabbitmq_clustered_hosts|length == 0 -%}
{%- if RABBITMQ_CLUSTERED is defined -%}
{%- set hosts= [] -%}
{%- for name in group_names -%}
{%- if name.startswith(rabbitmq_aws_stack_name) -%}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment