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