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