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
8ced6f37
Commit
8ced6f37
authored
Apr 27, 2018
by
Kevin Falcone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move deploy file into the main tasks
parent
dad85c04
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
157 additions
and
162 deletions
+157
-162
playbooks/roles/xqueue/tasks/deploy.yml
+0
-160
playbooks/roles/xqueue/tasks/main.yml
+157
-2
No files found.
playbooks/roles/xqueue/tasks/deploy.yml
deleted
100644 → 0
View file @
dad85c04
---
-
name
:
"
Writing
supervisor
scripts
-
xqueue,
xqueue
consumer"
template
:
src
:
"
{{
item
}}.conf.j2"
dest
:
"
{{
supervisor_available_dir
}}/{{
item
}}.conf"
owner
:
"
{{
supervisor_user
}}"
group
:
"
{{
common_web_user
}}"
mode
:
"
0644"
with_items
:
-
xqueue
-
xqueue_consumer
tags
:
-
install
-
install:configuration
-
name
:
"
Enabling
supervisor
scripts
-
xqueue,
xqueue
consumer"
file
:
src
:
"
{{
supervisor_available_dir
}}/{{
item
}}.conf"
dest
:
"
{{
supervisor_cfg_dir
}}/{{
item
}}.conf"
owner
:
"
{{
supervisor_user
}}"
group
:
"
{{
common_web_user
}}"
mode
:
"
0644"
state
:
link
force
:
yes
with_items
:
-
xqueue
-
xqueue_consumer
when
:
not disable_edx_services
tags
:
-
install
-
install:configuration
-
name
:
add gunicorn configuration file
template
:
src
:
"
xqueue_gunicorn.py.j2"
dest
:
"
{{
xqueue_app_dir
}}/xqueue_gunicorn.py"
become_user
:
"
{{
xqueue_user
}}"
tags
:
-
install
-
install:configuration
-
name
:
setup the app env file
template
:
src
:
"
xqueue_env.j2"
dest
:
"
{{
xqueue_app_dir
}}/xqueue_env"
owner
:
"
{{
xqueue_user
}}"
group
:
"
{{
common_web_group
}}"
mode
:
0644
tags
:
-
install
-
install:configuration
# Install the python requirements into {{ xqueue_venv_dir }}
-
name
:
"
Install
python
requirements"
pip
:
requirements
:
"
{{
xqueue_requirements_file
}}"
virtualenv
:
"
{{
xqueue_venv_dir
}}"
state
:
present
extra_args
:
"
-i
{{
COMMON_PYPI_MIRROR_URL
}}
--exists-action
w"
become_user
:
"
{{
xqueue_user
}}"
tags
:
-
install
-
install:app-requirements
# If this is an openstack deployment, install openstack requirements
-
name
:
Install python openstack requirements
pip
:
requirements
:
"
{{
xqueue_openstack_requirements_file
}}"
virtualenv
:
"
{{
xqueue_venv_dir
}}"
state
:
present
extra_args
:
"
-i
{{
COMMON_PYPI_MIRROR_URL
}}
--exists-action
w"
become_user
:
"
{{
xqueue_user
}}"
when
:
XQUEUE_SETTINGS == 'openstack_settings'
tags
:
-
install
-
install:app-requirements
# If there is a common user for migrations run migrations using his username
# and credentials. If not we use the xqueue mysql user
-
name
:
Migrate
shell
:
"
{{
xqueue_venv_bin
}}/django-admin.py
migrate
--noinput
--settings=xqueue.{{
XQUEUE_SETTINGS
}}
--pythonpath={{
xqueue_code_dir
}}"
become_user
:
"
{{
xqueue_user
}}"
environment
:
DB_MIGRATION_USER
:
"
{{
COMMON_MYSQL_MIGRATE_USER
}}"
DB_MIGRATION_PASS
:
"
{{
COMMON_MYSQL_MIGRATE_PASS
}}"
when
:
migrate_db is defined and migrate_db|lower == "yes" and COMMON_MYSQL_MIGRATE_PASS
run_once
:
yes
tags
:
-
migrate
-
migrate:db
-
name
:
Create users
shell
:
"
SERVICE_VARIANT=xqueue
{{
xqueue_venv_bin
}}/django-admin.py
update_users
--settings=xqueue.{{
XQUEUE_SETTINGS
}}
--pythonpath={{
xqueue_code_dir
}}"
become_user
:
"
{{
xqueue_user
}}"
when
:
not disable_edx_services
tags
:
-
manage
-
manage:app-users
# call supervisorctl update. this reloads
# the supervisorctl config and restarts
# the services if any of the configurations
# have changed.
#
-
name
:
Update supervisor configuration
shell
:
"
{{
supervisor_ctl
}}
-c
{{
supervisor_cfg
}}
update"
register
:
supervisor_update
changed_when
:
supervisor_update.stdout is defined and supervisor_update.stdout != ""
when
:
not disable_edx_services
-
name
:
Ensure xqueue, consumer is running
supervisorctl
:
name
:
"
{{
item
}}"
supervisorctl_path
:
"
{{
supervisor_ctl
}}"
config
:
"
{{
supervisor_cfg
}}"
state
:
started
with_items
:
-
xqueue
-
xqueue_consumer
when
:
not disable_edx_services
tags
:
-
manage
-
manage:start
-
name
:
Create a symlink for venv commands
file
:
src
:
"
{{
xqueue_venv_bin
}}/{{
item
}}"
dest
:
"
{{
COMMON_BIN_DIR
}}/{{
item
}}.xqueue"
state
:
link
with_items
:
-
python
-
pip
tags
:
-
install
-
install:app-requirements
-
name
:
Create symlinks for repo commands
file
:
src
:
"
{{
xqueue_code_dir
}}/{{
item
}}"
dest
:
"
{{
COMMON_BIN_DIR
}}/{{
item.split('.')[0]
}}.xqueue"
state
:
link
with_items
:
-
manage.py
tags
:
-
install
-
install:app-requirements
-
name
:
Restart xqueue
supervisorctl
:
name
:
"
{{
item
}}"
supervisorctl_path
:
"
{{
supervisor_ctl
}}"
config
:
"
{{
supervisor_cfg
}}"
state
:
restarted
when
:
not disable_edx_services
with_items
:
-
xqueue
-
xqueue_consumer
tags
:
-
manage
-
manage:start
playbooks/roles/xqueue/tasks/main.yml
View file @
8ced6f37
...
...
@@ -11,7 +11,162 @@
-
devstack
-
devstack:install
-
name
:
"
Writing
supervisor
scripts
-
xqueue,
xqueue
consumer"
template
:
src
:
"
{{
item
}}.conf.j2"
dest
:
"
{{
supervisor_available_dir
}}/{{
item
}}.conf"
owner
:
"
{{
supervisor_user
}}"
group
:
"
{{
common_web_user
}}"
mode
:
"
0644"
with_items
:
-
xqueue
-
xqueue_consumer
tags
:
-
install
-
install:configuration
-
name
:
"
Enabling
supervisor
scripts
-
xqueue,
xqueue
consumer"
file
:
src
:
"
{{
supervisor_available_dir
}}/{{
item
}}.conf"
dest
:
"
{{
supervisor_cfg_dir
}}/{{
item
}}.conf"
owner
:
"
{{
supervisor_user
}}"
group
:
"
{{
common_web_user
}}"
mode
:
"
0644"
state
:
link
force
:
yes
with_items
:
-
xqueue
-
xqueue_consumer
when
:
not disable_edx_services
tags
:
-
install
-
install:configuration
-
name
:
add gunicorn configuration file
template
:
src
:
"
xqueue_gunicorn.py.j2"
dest
:
"
{{
xqueue_app_dir
}}/xqueue_gunicorn.py"
become_user
:
"
{{
xqueue_user
}}"
tags
:
-
install
-
install:configuration
-
name
:
setup the app env file
template
:
src
:
"
xqueue_env.j2"
dest
:
"
{{
xqueue_app_dir
}}/xqueue_env"
owner
:
"
{{
xqueue_user
}}"
group
:
"
{{
common_web_group
}}"
mode
:
0644
tags
:
-
install
-
install:configuration
# Install the python requirements into {{ xqueue_venv_dir }}
-
name
:
"
Install
python
requirements"
pip
:
requirements
:
"
{{
xqueue_requirements_file
}}"
virtualenv
:
"
{{
xqueue_venv_dir
}}"
state
:
present
extra_args
:
"
-i
{{
COMMON_PYPI_MIRROR_URL
}}
--exists-action
w"
become_user
:
"
{{
xqueue_user
}}"
tags
:
-
install
-
install:app-requirements
# If this is an openstack deployment, install openstack requirements
-
name
:
Install python openstack requirements
pip
:
requirements
:
"
{{
xqueue_openstack_requirements_file
}}"
virtualenv
:
"
{{
xqueue_venv_dir
}}"
state
:
present
extra_args
:
"
-i
{{
COMMON_PYPI_MIRROR_URL
}}
--exists-action
w"
become_user
:
"
{{
xqueue_user
}}"
when
:
XQUEUE_SETTINGS == 'openstack_settings'
tags
:
-
install
-
install:app-requirements
# If there is a common user for migrations run migrations using his username
# and credentials. If not we use the xqueue mysql user
-
name
:
Migrate
shell
:
"
{{
xqueue_venv_bin
}}/django-admin.py
migrate
--noinput
--settings=xqueue.{{
XQUEUE_SETTINGS
}}
--pythonpath={{
xqueue_code_dir
}}"
become_user
:
"
{{
xqueue_user
}}"
environment
:
DB_MIGRATION_USER
:
"
{{
COMMON_MYSQL_MIGRATE_USER
}}"
DB_MIGRATION_PASS
:
"
{{
COMMON_MYSQL_MIGRATE_PASS
}}"
when
:
migrate_db is defined and migrate_db|lower == "yes" and COMMON_MYSQL_MIGRATE_PASS
run_once
:
yes
tags
:
-
migrate
-
migrate:db
-
name
:
Create users
shell
:
"
SERVICE_VARIANT=xqueue
{{
xqueue_venv_bin
}}/django-admin.py
update_users
--settings=xqueue.{{
XQUEUE_SETTINGS
}}
--pythonpath={{
xqueue_code_dir
}}"
become_user
:
"
{{
xqueue_user
}}"
when
:
not disable_edx_services
tags
:
-
manage
-
manage:app-users
# call supervisorctl update. this reloads
# the supervisorctl config and restarts
# the services if any of the configurations
# have changed.
#
-
name
:
Update supervisor configuration
shell
:
"
{{
supervisor_ctl
}}
-c
{{
supervisor_cfg
}}
update"
register
:
supervisor_update
changed_when
:
supervisor_update.stdout is defined and supervisor_update.stdout != ""
when
:
not disable_edx_services
-
name
:
Ensure xqueue, consumer is running
supervisorctl
:
name
:
"
{{
item
}}"
supervisorctl_path
:
"
{{
supervisor_ctl
}}"
config
:
"
{{
supervisor_cfg
}}"
state
:
started
with_items
:
-
xqueue
-
xqueue_consumer
when
:
not disable_edx_services
tags
:
-
manage
-
manage:start
-
name
:
Create a symlink for venv commands
file
:
src
:
"
{{
xqueue_venv_bin
}}/{{
item
}}"
dest
:
"
{{
COMMON_BIN_DIR
}}/{{
item
}}.xqueue"
state
:
link
with_items
:
-
python
-
pip
tags
:
-
install
-
install:app-requirements
-
name
:
Create symlinks for repo commands
file
:
src
:
"
{{
xqueue_code_dir
}}/{{
item
}}"
dest
:
"
{{
COMMON_BIN_DIR
}}/{{
item.split('.')[0]
}}.xqueue"
state
:
link
with_items
:
-
manage.py
tags
:
-
install
-
install:app-requirements
-
include
:
deploy.yml
-
name
:
Restart xqueue
supervisorctl
:
name
:
"
{{
item
}}"
supervisorctl_path
:
"
{{
supervisor_ctl
}}"
config
:
"
{{
supervisor_cfg
}}"
state
:
restarted
when
:
not disable_edx_services
with_items
:
-
xqueue
-
xqueue_consumer
tags
:
-
deploy
-
manage
-
manage:start
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