Commit 5ec97225 by Feanil Patel Committed by GitHub

Merge pull request #4064 from edx/aali/OPS_2209_upgrade_sandbox_mongo_role

Aali/ops 2209 upgrade sandbox mongo role
parents 854ba162 63a885a0
......@@ -22,7 +22,7 @@
- role: edxlocal
tags: edxlocal
- memcache
- mongo
- mongo_3_2
- { role: 'edxapp', celery_worker: True }
- edxapp
- testcourses
......
......@@ -10,3 +10,6 @@
service:
name: "{{ supervisor_service }}"
state: restarted
register: rc
until: rc|success
retries: 5
......@@ -49,10 +49,14 @@ MONGO_BIND_IP: 127.0.0.1
MONGO_REPL_SET: "rs0"
MONGO_AUTH: true
MONGO_CLUSTER_KEY: "CHANGEME"
# Cluster member configuration
# Fed directly into mongodb_replica_set module
MONGO_RS_CONFIG:
members: []
_id: '{{ MONGO_REPL_SET }}'
members:
- host: '127.0.0.1'
# Storage engine options in 3.2: "mmapv1" or "wiredTiger"
# 3.2 and 3.4 default to wiredTiger
......
......@@ -104,7 +104,7 @@
# and connect anonymously next.
- name: determine if there is a replica set already
mongodb_rs_status:
host: "{{ ansible_default_ipv4['address'] }}"
host: "{{ ansible_lo['ipv4']['address'] }}"
username: "{{ MONGO_ADMIN_USER }}"
password: "{{ MONGO_ADMIN_PASSWORD }}"
run_once: true
......@@ -116,7 +116,7 @@
- name: Try checking the replica set with no user/pass in case this is a new box
mongodb_rs_status:
host: "{{ ansible_default_ipv4['address'] }}"
host: "{{ ansible_lo['ipv4']['address'] }}"
run_once: true
register: unauthed_replica_set_already_configured
when: authed_replica_set_already_configured.failed is defined
......@@ -289,7 +289,7 @@
# checking the replica set status until we see a PRIMARY in the results.
- name: Wait for the replica set to update and (if needed) elect a primary
mongodb_rs_status:
host: "{{ ansible_default_ipv4['address'] }}"
host: "{{ ansible_lo['ipv4']['address'] }}"
username: "{{ MONGO_ADMIN_USER }}"
password: "{{ MONGO_ADMIN_PASSWORD }}"
register: status
......@@ -319,3 +319,12 @@
- "manage"
- "manage:db"
- "manage:db-replication"
- name: ensure mongo starts at boot time
service:
name: mongod
enabled: yes
tags:
- "manage"
- "manage:start"
......@@ -127,9 +127,9 @@ fi
if [[ -z $ami ]]; then
if [[ $server_type == "full_edx_installation" ]]; then
ami="ami-c20128d4"
ami="ami-dd9d81a6"
elif [[ $server_type == "ubuntu_16.04" || $server_type == "full_edx_installation_from_scratch" ]]; then
ami="ami-20631a36"
ami="ami-1d4e7a66"
fi
fi
......
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