Commit 62df7fce by John Jarvis

Merge pull request #1201 from edx/jarv/diff-and-check

Jarv/diff and check
parents ec9356f0 f77cbfe3
...@@ -34,11 +34,13 @@ ...@@ -34,11 +34,13 @@
/edx/bin/s3cmd get {{ s3cmd_out_forum.stdout }} --skip-existing /edx/bin/s3cmd get {{ s3cmd_out_forum.stdout }} --skip-existing
chdir=/mnt chdir=/mnt
tags: update_mongo_data tags: update_mongo_data
when: s3cmd_out_forum.stdout is defined
- name: untar the s3 backup - name: untar the s3 backup
shell: > shell: >
tar zxf {{ s3cmd_out_forum.stdout|basename }} tar zxf {{ s3cmd_out_forum.stdout|basename }}
chdir=/mnt chdir=/mnt
when: s3cmd_out_forum.stdout is defined
tags: update_mongo_data tags: update_mongo_data
...@@ -53,12 +55,14 @@ ...@@ -53,12 +55,14 @@
/edx/bin/s3cmd get {{ s3cmd_out_modulestore.stdout }} --skip-existing /edx/bin/s3cmd get {{ s3cmd_out_modulestore.stdout }} --skip-existing
chdir=/mnt chdir=/mnt
tags: update_mongo_data tags: update_mongo_data
when: s3cmd_out_modulestore.stdout is defined
- name: untar the s3 backup - name: untar the s3 backup
shell: > shell: >
tar zxf {{ s3cmd_out_modulestore.stdout|basename }} tar zxf {{ s3cmd_out_modulestore.stdout|basename }}
chdir=/mnt chdir=/mnt
tags: update_mongo_data tags: update_mongo_data
when: s3cmd_out_modulestore.stdout is defined
- name: Restore the mongo data for the forums - name: Restore the mongo data for the forums
shell: > shell: >
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
- name: update supervisor configuration - name: update supervisor configuration
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update" shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update register: supervisor_update
changed_when: supervisor_update.stdout != "" changed_when: supervisor_update.stdout is defined and supervisor_update.stdout != ""
when: not disable_edx_services when: not disable_edx_services
- name: ensure alton is started - name: ensure alton is started
...@@ -54,4 +54,4 @@ ...@@ -54,4 +54,4 @@
config={{ supervisor_cfg }} config={{ supervisor_cfg }}
state=started state=started
when: not disable_edx_services when: not disable_edx_services
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update" shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update register: supervisor_update
sudo_user: "{{ supervisor_service_user }}" sudo_user: "{{ supervisor_service_user }}"
changed_when: supervisor_update.stdout != "" changed_when: supervisor_update.stdout is defined and supervisor_update.stdout != ""
when: not disable_edx_services when: not disable_edx_services
- name: ensure certs has started - name: ensure certs has started
......
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
- name: update devpi supervisor configuration - name: update devpi supervisor configuration
shell: "{{ devpi_supervisor_ctl }} -c {{ devpi_supervisor_cfg }} update" shell: "{{ devpi_supervisor_ctl }} -c {{ devpi_supervisor_cfg }} update"
register: supervisor_update register: supervisor_update
changed_when: supervisor_update.stdout != "" changed_when: supervisor_update.stdout is defined and supervisor_update.stdout != ""
- name: ensure devpi is started - name: ensure devpi is started
supervisorctl_local: > supervisorctl_local: >
......
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update" shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update register: supervisor_update
sudo_user: "{{ supervisor_service_user }}" sudo_user: "{{ supervisor_service_user }}"
changed_when: supervisor_update.stdout != "" changed_when: supervisor_update.stdout is defined and supervisor_update.stdout != ""
when: not disable_edx_services when: not disable_edx_services
- name: ensure discern, discern_celery has started - name: ensure discern, discern_celery has started
......
...@@ -309,7 +309,7 @@ ...@@ -309,7 +309,7 @@
sudo_user: "{{ edxapp_sandbox_user }}" sudo_user: "{{ edxapp_sandbox_user }}"
when: EDXAPP_PYTHON_SANDBOX when: EDXAPP_PYTHON_SANDBOX
register: sandbox_install_output register: sandbox_install_output
changed_when: "'installed' in sandbox_install_output" changed_when: sandbox_install_output.stdout is defined and 'installed' in sandbox_install_output.stdout
notify: notify:
- "restart edxapp" - "restart edxapp"
- "restart edxapp_workers" - "restart edxapp_workers"
...@@ -372,7 +372,7 @@ ...@@ -372,7 +372,7 @@
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update" shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update register: supervisor_update
sudo_user: "{{ supervisor_service_user }}" sudo_user: "{{ supervisor_service_user }}"
changed_when: supervisor_update.stdout != "" changed_when: supervisor_update.stdout is defined and supervisor_update.stdout != ""
when: not disable_edx_services when: not disable_edx_services
- name: ensure edxapp has started - name: ensure edxapp has started
......
...@@ -62,6 +62,6 @@ ...@@ -62,6 +62,6 @@
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update" shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update register: supervisor_update
sudo_user: "{{ supervisor_service_user }}" sudo_user: "{{ supervisor_service_user }}"
changed_when: supervisor_update.stdout != "" changed_when: supervisor_update.stdout is defined and supervisor_update.stdout != ""
notify: notify:
- "restart flower" - "restart flower"
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
- name: update supervisor configuration - name: update supervisor configuration
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update" shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update register: supervisor_update
changed_when: supervisor_update.stdout != "" changed_when: supervisor_update.stdout is defined supervisor_update.stdout != ""
when: not disable_edx_services when: not disable_edx_services
- name: ensure forum is started - name: ensure forum is started
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update" shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update register: supervisor_update
when: not disable_edx_services when: not disable_edx_services
changed_when: supervisor_update.stdout != "" changed_when: supervisor_update.stdout is defined supervisor_update.stdout != ""
- name: ensure ora is started - name: ensure ora is started
supervisorctl_local: > supervisorctl_local: >
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
shell: > shell: >
gdebi --n {{ rabbitmq_pkg_url|basename }} gdebi --n {{ rabbitmq_pkg_url|basename }}
chdir=/var/tmp chdir=/var/tmp
when: is_installed.stdout == "not installed" when: is_installed.stdout is defined and is_installed.stdout == "not installed"
- name: stop rabbit cluster - name: stop rabbit cluster
service: name=rabbitmq-server state=stopped service: name=rabbitmq-server state=stopped
......
...@@ -83,16 +83,16 @@ ...@@ -83,16 +83,16 @@
git: > git: >
repo=https://github.com/sstephenson/ruby-build.git dest={{ tempdir.stdout }}/ruby-build repo=https://github.com/sstephenson/ruby-build.git dest={{ tempdir.stdout }}/ruby-build
accept_hostkey=yes accept_hostkey=yes
when: rbuild_present|failed or (installable_ruby_vers is defined and rbenv_ruby_version not in installable_ruby_vers) when: tempdir.stdout is defined and (rbuild_present|failed or (installable_ruby_vers is defined and rbenv_ruby_version not in installable_ruby_vers))
sudo_user: "{{ rbenv_user }}" sudo_user: "{{ rbenv_user }}"
- name: install ruby-build - name: install ruby-build
command: ./install.sh chdir={{ tempdir.stdout }}/ruby-build command: ./install.sh chdir={{ tempdir.stdout }}/ruby-build
when: rbuild_present|failed or (installable_ruby_vers is defined and rbenv_ruby_version not in installable_ruby_vers) when: tempdir.stdout is defined and (rbuild_present|failed or (installable_ruby_vers is defined and rbenv_ruby_version not in installable_ruby_vers))
- name: remove temporary directory - name: remove temporary directory
file: path={{ tempdir.stdout }} state=absent file: path={{ tempdir.stdout }} state=absent
when: rbuild_present|failed or (installable_ruby_vers is defined and rbenv_ruby_version not in installable_ruby_vers) when: tempdir.stdout is defined and (rbuild_present|failed or (installable_ruby_vers is defined and rbenv_ruby_version not in installable_ruby_vers))
- name: check ruby {{ rbenv_ruby_version }} installed - name: check ruby {{ rbenv_ruby_version }} installed
shell: "rbenv versions | grep {{ rbenv_ruby_version }}" shell: "rbenv versions | grep {{ rbenv_ruby_version }}"
......
...@@ -25,37 +25,37 @@ ...@@ -25,37 +25,37 @@
- name: stop supervisor - name: stop supervisor
stat: path=/etc/init/supervisor.conf stat: path=/etc/init/supervisor.conf
register: stat_out register: stat_out
changed_when: stat_out.stat.exists changed_when: stat_out is defined and stat_out.stat.exists
notify: stop supervisor notify: stop supervisor
- name: stop supervisor.devpi - name: stop supervisor.devpi
stat: path=/etc/init/supervisor.devpi.conf stat: path=/etc/init/supervisor.devpi.conf
register: stat_out register: stat_out
changed_when: stat_out.stat.exists changed_when: stat_out is defined and stat_out.stat.exists
notify: stop supervisor notify: stop supervisor
- name: stop nginx - name: stop nginx
stat: path=/etc/init.d/nginx stat: path=/etc/init.d/nginx
register: stat_out register: stat_out
changed_when: stat_out.stat.exists changed_when: stat_out is defined and stat_out.stat.exists
notify: stop nginx notify: stop nginx
- name: stop rabbitmq-server - name: stop rabbitmq-server
stat: path=/etc/init.d/rabbitmq-server stat: path=/etc/init.d/rabbitmq-server
register: stat_out register: stat_out
changed_when: stat_out.stat.exists changed_when: stat_out is defined and stat_out.stat.exists
notify: stop rabbitmq-server notify: stop rabbitmq-server
- name: stop memcached - name: stop memcached
stat: path=/etc/init.d/memcached stat: path=/etc/init.d/memcached
register: stat_out register: stat_out
changed_when: stat_out.stat.exists changed_when: stat_out is defined and stat_out.stat.exists
notify: stop memcached notify: stop memcached
- name: stop mongodb - name: stop mongodb
stat: path=/etc/init.d/mongodb stat: path=/etc/init.d/mongodb
register: stat_out register: stat_out
changed_when: stat_out.stat.exists changed_when: stat_out is defined and stat_out.stat.exists
notify: stop mongodb notify: stop mongodb
- shell: "true" - shell: "true"
......
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
- name: write the pre_suprevisor python script - name: write the pre_suprevisor python script
copy: > copy: >
src=pre_supervisor_checks.py src=pre_supervisor_checks.py
dest={{ supervisor_app_dir }}/pre_supervisor_checks.py dest={{ supervisor_app_dir }}/pre_supervisor_checks.py
mode=0750 mode=0750
owner={{ supervisor_user }} owner={{ supervisor_user }}
...@@ -166,4 +166,4 @@ ...@@ -166,4 +166,4 @@
- name: update supervisor configuration - name: update supervisor configuration
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update" shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update register: supervisor_update
changed_when: supervisor_update.stdout != "" changed_when: supervisor_update.stdout is defined and supervisor_update.stdout != ""
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
- name: update supervisor configuration - name: update supervisor configuration
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update" shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update register: supervisor_update
changed_when: supervisor_update.stdout != "" changed_when: supervisor_update.stdout is defined and supervisor_update.stdout != ""
when: not disable_edx_services when: not disable_edx_services
- name: ensure xqueue, consumer is running - name: ensure xqueue, consumer is running
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
- name: update supervisor configuration - name: update supervisor configuration
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update" shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update register: supervisor_update
changed_when: supervisor_update.stdout != "" changed_when: supervisor_update.stdout is defined and supervisor_update.stdout != ""
when: not disable_edx_services when: not disable_edx_services
- name: ensure xserver is started - name: ensure xserver is started
......
...@@ -31,6 +31,10 @@ if [[ $run_migrations == "true" ]]; then ...@@ -31,6 +31,10 @@ if [[ $run_migrations == "true" ]]; then
ansible_extra_vars+=" -e migrate_db=yes" ansible_extra_vars+=" -e migrate_db=yes"
fi fi
if [[ $check_mode == "true" ]]; then
ansible_extra_vars+=" --check"
fi
if [[ ! -z "$run_on_single_ip" ]]; then if [[ ! -z "$run_on_single_ip" ]]; then
ansible_limit+="$run_on_single_ip" ansible_limit+="$run_on_single_ip"
else else
...@@ -46,4 +50,4 @@ fi ...@@ -46,4 +50,4 @@ fi
export PYTHONUNBUFFERED=1 export PYTHONUNBUFFERED=1
env env
ansible-playbook -v -u ubuntu $ansible_play -i ./ec2.py $ansible_task_tags --limit $ansible_limit -e@"$WORKSPACE/configuration-secure/ansible/vars/${deployment_tag}.yml" -e@"$WORKSPACE/configuration-secure/ansible/vars/${environment_tag}-${deployment_tag}.yml" $ansible_extra_vars ansible-playbook -v -D -u ubuntu $ansible_play -i ./ec2.py $ansible_task_tags --limit $ansible_limit -e@"$WORKSPACE/configuration-secure/ansible/vars/${deployment_tag}.yml" -e@"$WORKSPACE/configuration-secure/ansible/vars/${environment_tag}-${deployment_tag}.yml" $ansible_extra_vars
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