Commit c2434ddb by Fred Smith

Merge pull request #1637 from edx/derf/mongodb_upgrade

move from mongo 10gen to org
parents 8f157133 11924321
mongo_logappend: true
mongo_version: 2.4.7
mongo_version: 2.6.4
mongo_port: "27017"
mongo_extra_conf: ''
mongo_key_file: '/etc/mongodb_key'
......
---
- name: check to see that MongoDB 2.4 isn't installed
stat: path=/etc/init.d/mongodb
register: mongodb_needs_upgrade
- name: verify 2.4 not installed
fail: msg="MongoDB 2.4 is currently installed. Check http://docs.mongodb.org/manual/release-notes/2.6-upgrade/#upgrade-considerations - automated upgrade to follow"
when: mongodb_needs_upgrade.stat.exists
- name: install python pymongo for mongo_user ansible module
pip: >
name=pymongo state=present
......@@ -18,7 +27,7 @@
- name: install mongo server and recommends
apt: >
pkg=mongodb-10gen={{ mongo_version }}
pkg=mongodb-org={{ mongo_version }}
state=present install_recommends=yes
force=yes update_cache=yes
......@@ -32,8 +41,8 @@
- "{{ mongo_dbpath }}"
- "{{ mongo_log_dir }}"
- name: stop mongo service
service: name=mongodb state=stopped
- name: stop mongod service
service: name=mongod state=stopped
- name: move mongodb to {{ mongo_data_dir }}
command: mv /var/lib/mongodb {{ mongo_data_dir}}/. creates={{ mongo_data_dir }}/mongodb
......@@ -49,11 +58,11 @@
when: MONGO_CLUSTERED
- name: copy configuration template
template: src=mongodb.conf.j2 dest=/etc/mongodb.conf backup=yes
template: src=mongodb.conf.j2 dest=/etc/mongod.conf backup=yes
notify: restart mongo
- name: start mongo service
service: name=mongodb state=started
service: name=mongod state=started
- name: wait for mongo server to start
wait_for: port=27017 delay=2
......
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