Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
e6020f40
Commit
e6020f40
authored
Jul 10, 2018
by
Joseph Mulloy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add nginx maintenance page playbook OPS-3164
parent
65154b1a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
135 additions
and
0 deletions
+135
-0
playbooks/edx_maintenance.yml
+20
-0
playbooks/roles/edx_maintenance/defaults/main.yml
+21
-0
playbooks/roles/edx_maintenance/meta/main.yml
+23
-0
playbooks/roles/edx_maintenance/tasks/main.yml
+71
-0
No files found.
playbooks/edx_maintenance.yml
0 → 100644
View file @
e6020f40
# Usage:
#
# By default this playbook will disable the maintenance mode
#
# Enable maintenance
# ansible-playbook ./edx_maintenance.yml -i host1.example.com,host2.example.com, -e '{"ENABLE_MAINTENANCE": True}'
#
# Disable maintenance
# ansible-playbook ./edx_maintenance.yml -i host1.example.com,host2.example.com, -e '{"ENABLE_MAINTENANCE": False}'
# ansible-playbook ./edx_maintenance.yml -i host1.example.com,host2.example.com,
#
-
name
:
Deploy edxapp
hosts
:
all
become
:
True
gather_facts
:
True
vars_files
:
-
'
roles/nginx/defaults/main.yml'
-
'
roles/supervisor/defaults/main.yml'
roles
:
-
role
:
edx_maintenance
playbooks/roles/edx_maintenance/defaults/main.yml
0 → 100644
View file @
e6020f40
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://openedx.atlassian.net/wiki/display/OpenOPS
# code style: https://openedx.atlassian.net/wiki/display/OpenOPS/Ansible+Code+Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Defaults for role edx_maintenance
#
#
# vars are namespace with the module name.
#
ENABLE_MAINTENANCE
:
False
EDX_MAINTENANCE_SUPERVISOR_APPS
:
-
'
lms'
-
'
cms'
-
'
edxapp_worker:'
playbooks/roles/edx_maintenance/meta/main.yml
0 → 100644
View file @
e6020f40
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://openedx.atlassian.net/wiki/display/OpenOPS
# code style: https://openedx.atlassian.net/wiki/display/OpenOPS/Ansible+Code+Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Role includes for role edx_maintenance
#
# Example:
#
# dependencies:
# - {
# role: my_role
# my_role_var0: "foo"
# my_role_var1: "bar"
# }
dependencies
:
-
common_vars
playbooks/roles/edx_maintenance/tasks/main.yml
0 → 100644
View file @
e6020f40
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://openedx.atlassian.net/wiki/display/OpenOPS
# code style: https://openedx.atlassian.net/wiki/display/OpenOPS/Ansible+Code+Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
#
# Tasks for role edx_maintenance
#
-
name
:
Find supervisor apps
supervisorctl
:
name
:
"
{{
item
}}"
supervisorctl_path
:
"
{{
supervisor_ctl
}}"
config
:
"
{{
supervisor_cfg
}}"
state
:
present
become_user
:
"
{{
supervisor_service_user
}}"
ignore_errors
:
yes
register
:
supervisor_apps
with_items
:
"
{{
EDX_MAINTENANCE_SUPERVISOR_APPS
}}"
tags
:
-
manage
-
name
:
Enable fake heartbeat
copy
:
content
:
"
"
dest
:
"
{{
nginx_server_static_dir
}}/maintenance_heartbeat.txt"
owner
:
root
group
:
"
{{
common_web_user
}}"
mode
:
"
0640"
when
:
ENABLE_MAINTENANCE
tags
:
-
manage
-
name
:
Stop edxapp
supervisorctl
:
# Use item.item because item.item strips the : off of edxapp_worker:
name
:
"
{{
item.item
}}"
supervisorctl_path
:
"
{{
supervisor_ctl
}}"
config
:
"
{{
supervisor_cfg
}}"
state
:
stopped
become_user
:
"
{{
supervisor_service_user
}}"
when
:
ENABLE_MAINTENANCE and not item is failed
with_items
:
"
{{
supervisor_apps.results
}}"
tags
:
-
manage
-
name
:
Start edxap
supervisorctl
:
# Use item.item because item.item strips the : off of edxapp_worker:
name
:
"
{{
item.item
}}"
supervisorctl_path
:
"
{{
supervisor_ctl
}}"
config
:
"
{{
supervisor_cfg
}}"
state
:
started
become_user
:
"
{{
supervisor_service_user
}}"
when
:
not ENABLE_MAINTENANCE and not item is failed
with_items
:
"
{{
supervisor_apps.results
}}"
tags
:
-
manage
-
name
:
Disable fake heartbeat
file
:
dest
:
"
{{
nginx_server_static_dir
}}/maintenance_heartbeat.txt"
state
:
absent
when
:
not ENABLE_MAINTENANCE
tags
:
-
manage
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment