use YAML syntax for ansible tasks

parent a2ce7bd7
...@@ -19,26 +19,44 @@ ...@@ -19,26 +19,44 @@
# #
# #
- name: stop supervisor - name: stop supervisor
service: name=supervisor state=stopped arguments="{{ STOP_ALL_EDX_SERVICES_EXTRA_ARGS }}" service:
name: supervisor
state: stopped
arguments: "{{ STOP_ALL_EDX_SERVICES_EXTRA_ARGS }}"
- name: stop nginx - name: stop nginx
service: name=nginx state=stopped arguments="{{ STOP_ALL_EDX_SERVICES_EXTRA_ARGS }}" service:
name: nginx
state: stopped
arguments: "{{ STOP_ALL_EDX_SERVICES_EXTRA_ARGS }}"
- name: stop rabbitmq-server - name: stop rabbitmq-server
service: name=rabbitmq-server state=stopped arguments="{{ STOP_ALL_EDX_SERVICES_EXTRA_ARGS }}" service:
name: rabbitmq-server
state: stopped
arguments: "{{ STOP_ALL_EDX_SERVICES_EXTRA_ARGS }}"
- name: stop mysql - name: stop mysql
service: name=mysql state=stopped arguments="{{ STOP_ALL_EDX_SERVICES_EXTRA_ARGS }}" service:
name: mysql
state: stopped
arguments: "{{ STOP_ALL_EDX_SERVICES_EXTRA_ARGS }}"
- name: stop memcached - name: stop memcached
service: name=memcached state=stopped arguments="{{ STOP_ALL_EDX_SERVICES_EXTRA_ARGS }}" service:
name: memcached
state: stopped
arguments: "{{ STOP_ALL_EDX_SERVICES_EXTRA_ARGS }}"
- name: stop mongodb - name: stop mongodb
service: name=mongodb state=stopped arguments="{{ STOP_ALL_EDX_SERVICES_EXTRA_ARGS }}" service:
name: mongodb
state: stopped
arguments: "{{ STOP_ALL_EDX_SERVICES_EXTRA_ARGS }}"
# Celery and Supervisord should not be killed because they may have long running tasks that need to finish # Celery and Supervisord should not be killed because they may have long running tasks that need to finish
- name: kill processes by user - name: kill processes by user
shell: pgrep -u {{ item }} -lf | grep -v celery | grep -v supervisord | grep -v gunicorn | awk '{ print $1}' | xargs -I {} kill {} || true shell: pgrep -u {{ item }} -lf | grep -v celery | grep -v supervisord | grep -v gunicorn | awk '{ print $1}' | xargs -I {} kill {} || true
with_items: with_items:
- www-data - www-data
- rabbitmq - rabbitmq
...@@ -22,35 +22,45 @@ ...@@ -22,35 +22,45 @@
# - stop_all_edx_services # - stop_all_edx_services
# #
# #
- 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 is defined and 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 is defined and 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 is defined and 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 is defined and 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 is defined and 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"
notify: kill processes by user notify: kill processes by user
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