Commit faafbcd4 by Jason Bau

Merge pull request #169 from edx/jbau/safer_migrate_db

Make the condition on migrate_db a bit safer for using in var_prompt
parents d6ec69b6 93d4bffa
# this gets all running prod webservers
#- hosts: tag_environment_prod:&tag_function_webserver
# or we can get subsets of them by name
- hosts: ~tag_Name_app(12|22)_prod
- hosts: ~tag_Name_app(4)_prod
#- hosts: ~tag_Name_app(11|21)_prod
## these are cold hosts:
#- hosts: ~tag_Name_app(12|22)_prod
......@@ -12,8 +12,8 @@
sudo: True
vars_prompt:
- name: "migrate_db"
prompt: "Should this playbook run database migrations? (<Return> for false, anything else for true)"
default: false
prompt: "Should this playbook run database migrations? (Type 'yes' to run, anything else to skip migrations)"
default: "no"
private: no
vars:
secure_dir: '../../../configuration-secure/ansible'
......
# this gets all running prod webservers
- hosts: tag_environment_prod:&tag_function_util
# or we can get subsets of them by name
#- hosts: ~tag_Name_util(1|2)_prod
sudo: True
vars:
secure_dir: '../../../configuration-secure/ansible'
# this indicates the path to site-specific (with precedence)
# things like nginx template files
local_dir: '../../../configuration-secure/ansible/local'
migrate_db: "no"
vars_files:
- "{{ secure_dir }}/vars/edxapp_prod_vars.yml"
- "{{ secure_dir }}/vars/users.yml"
- "{{ secure_dir }}/vars/edxapp_prod_users.yml"
- "{{ secure_dir }}/vars/shib_prod_vars.yml"
roles:
- common
- { role: 'edxapp', celery_worker: True }
......@@ -9,8 +9,9 @@
# this indicates the path to site-specific (with precedence)
# things like nginx template files
local_dir: '../../../configuration-secure/ansible/local'
migrate_db: "no"
vars_files:
- "{{ secure_dir }}/vars/edxapp_prod_vars.yml"
- "{{ secure_dir }}/vars/ora_prod_vars.yml"
- "{{ secure_dir }}/vars/users.yml"
- "{{ secure_dir }}/vars/edxapp_prod_users.yml"
roles:
......
......@@ -3,7 +3,7 @@
sudo: True
gather_facts: True
vars:
migrate_db: True
migrate_db: "yes"
openid_workaround: True
ansible_ssh_private_key_file: /var/lib/jenkins/continuous-integration.pem
vars_files:
......
......@@ -17,7 +17,7 @@
sudo: True
gather_facts: True
vars:
migrate_db: True
migrate_db: "yes"
openid_workaround: True
ansible_ssh_private_key_file: /var/lib/jenkins/continuous-integration.pem
vars_files:
......
......@@ -19,7 +19,7 @@
sudo: True
gather_facts: True
vars:
migrate_db: True
migrate_db: "yes"
openid_workaround: True
roles:
- common
......
......@@ -189,7 +189,7 @@
- name: syncdb and migrate
shell: sudo -u www-data SERVICE_VARIANT=lms /opt/edx/bin/django-admin.py syncdb --migrate --noinput --settings=lms.envs.aws --pythonpath=/opt/wwc/edx-platform
when: migrate_db is defined
when: migrate_db is defined and migrate_db|lower == "yes"
tags:
- deploy
- lms
......
......@@ -86,7 +86,7 @@
- name: syncdb and migrate
shell: sudo -u www-data {{ora_venv_dir}}/bin/django-admin.py syncdb --migrate --noinput --settings=edx_ora.aws --pythonpath={{ora_code_dir}}
when: migrate_db
when: migrate_db is defined and migrate_db|lower == "yes"
notify:
- restart edx-ora
- restart edx-ora-celery
......
......@@ -53,7 +53,7 @@
- name: syncdb and migrate
shell: sudo -u www-data /opt/edx/bin/django-admin.py syncdb --migrate --noinput --settings=xqueue.aws_settings --pythonpath=/opt/wwc/xqueue
when: migrate_db
when: migrate_db is defined and migrate_db|lower == "yes"
tags:
- xqueue
- syncdb
......
......@@ -3,7 +3,7 @@
sudo: True
gather_facts: True
vars:
migrate_db: True
migrate_db: "yes"
openid_workaround: True
vars_files:
- "group_vars/all"
......
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