Commit 5e551d86 by John Jarvis

adding role to stop all edx services

parent cccc0004
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Defaults for role stop_all_edx_services
#
#
# vars are namespace with the module name.
#
stop_all_edx_services_role_name: stop_all_edx_services
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
#
# Handlers for role stop_all_edx_services
#
# Overview:
#
# This stops all services on an edX server
# so that everything is shutdown prior to creating
# an AMI.
#
#
- name: stop supervisor
service: name=supervisor state=stopped
- name: stop supervisor.devpi
service: name=supervisor.devpi state=stopped
- name: stop nginx
service: name=nginx state=stopped
- name: stop rabbitmq-server
service: name=rabbitmq-server state=stopped
- name: stop mysql
service: name=mysql state=stopped
- name: stop memcached
service: name=memcached state=stopped
- name: stop supervisor.devpi
service: name=supervisor.devpi state=stopped
- name: stop nginx
service: name=nginx state=stopped
- name: stop rabbitmq-server
service: name=rabbitmq-server state=stopped
- name: stop mongodb
service: name=mongodb state=stopped
- name: kill processes by user
shell: pkill -u {{ item }} || true
with_items:
- www-data
- devpi.supervisor
- rabbitmq
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
#
# Tasks for role stop_all_edx_services
#
# Overview:
#
# This stops all services on an edX server
# so that everything is shutdown prior to creating
# an AMI.
#
# Example play:
# roles:
# - stop_all_edx_services
#
#
- name: stop supervisor
stat: path=/etc/init/supervisor.conf
register: stat_out
changed_when: stat_out.stat.exists
notify: stop supervisor
- name: stop supervisor.devpi
stat: path=/etc/init/supervisor.devpi.conf
register: stat_out
changed_when: stat_out.stat.exists
notify: stop supervisor
- name: stop nginx
stat: path=/etc/init.d/nginx
register: stat_out
changed_when: stat_out.stat.exists
notify: stop nginx
- name: stop rabbitmq-server
stat: path=/etc/init.d/rabbitmq-server
register: stat_out
changed_when: stat_out.stat.exists
notify: stop rabbitmq-server
- name: stop memcached
stat: path=/etc/init.d/memcached
register: stat_out
changed_when: stat_out.stat.exists
notify: stop memcached
- name: stop mongodb
stat: path=/etc/init.d/mongodb
register: stat_out
changed_when: stat_out.stat.exists
notify: stop mongodb
- shell: "true"
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