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
57afc315
Commit
57afc315
authored
Oct 23, 2013
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updating xqueue for new directory structure
parent
de71ca54
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
86 deletions
+37
-86
playbooks/group_vars/all
+2
-0
playbooks/roles/edxapp/defaults/main.yml
+1
-2
playbooks/roles/xqueue/defaults/main.yml
+6
-6
playbooks/roles/xqueue/tasks/deploy.yml
+11
-36
playbooks/roles/xqueue/tasks/main.yml
+17
-42
No files found.
playbooks/group_vars/all
View file @
57afc315
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
data_dir: /edx/var
data_dir: /edx/var
app_dir: /edx/app
app_dir: /edx/app
log_dir: "{{ data_dir }}/log"
log_dir: "{{ data_dir }}/log"
venvs_dir: "{{ app_dir }}/venvs"
os_name: ubuntu
os_name: ubuntu
ENV_NAME: 'default_env'
ENV_NAME: 'default_env'
...
...
playbooks/roles/edxapp/defaults/main.yml
View file @
57afc315
...
@@ -95,8 +95,7 @@ EDXAPP_LMS_PREVIEW_BASIC_AUTH: False
...
@@ -95,8 +95,7 @@ EDXAPP_LMS_PREVIEW_BASIC_AUTH: False
edxapp_data_dir
:
"
{{
data_dir
}}/edxapp"
edxapp_data_dir
:
"
{{
data_dir
}}/edxapp"
edxapp_app_dir
:
"
{{
app_dir
}}/edxapp"
edxapp_app_dir
:
"
{{
app_dir
}}/edxapp"
edxapp_log_dir
:
"
{{
log_dir
}}/edxapp"
edxapp_log_dir
:
"
{{
log_dir
}}/edxapp"
edxapp_venvs_dir
:
"
{{
app_dir
}}/venvs"
edxapp_venv_dir
:
"
{{
venvs_dir
}}/edxapp"
edxapp_venv_dir
:
"
{{
edxapp_venvs_dir
}}/edxapp"
edxapp_venv_bin
:
"
{{
edxapp_venv_dir
}}/bin"
edxapp_venv_bin
:
"
{{
edxapp_venv_dir
}}/bin"
edxapp_rbenv_dir
:
"
{{
edxapp_app_dir
}}"
edxapp_rbenv_dir
:
"
{{
edxapp_app_dir
}}"
edxapp_rbenv_root
:
"
{{
edxapp_rbenv_dir
}}/.rbenv"
edxapp_rbenv_root
:
"
{{
edxapp_rbenv_dir
}}/.rbenv"
...
...
playbooks/roles/xqueue/defaults/main.yml
View file @
57afc315
...
@@ -4,19 +4,19 @@
...
@@ -4,19 +4,19 @@
XQUEUE_NGINX_PORT
:
18040
XQUEUE_NGINX_PORT
:
18040
XQUEUE_BASIC_AUTH
:
False
XQUEUE_BASIC_AUTH
:
False
xqueue_code_dir
:
"
{{
app_dir
}}/xqueue"
xqueue_app_dir
:
"
{{
app_dir
}}/xqueue"
xqueue_code_dir
:
"
{{
xqueue_app_dir
}}/xqueue"
xqueue_data_dir
:
"
{{
data_dir
}}/xqueue"
xqueue_venv_dir
:
"
{{
venvs_dir
}}/xqueue"
xqueue_venv_bin
:
"
{{
xqueue_venv_dir
}}/bin"
xqueue_user
:
"
xqueue"
# Default nginx listen port
# Default nginx listen port
# These should be overrided if you want
# These should be overrided if you want
# to serve all content on port 80
# to serve all content on port 80
xqueue_code_dir
:
"
{{
app_dir
}}/xqueue"
xqueue_gunicorn_port
:
8040
xqueue_gunicorn_port
:
8040
xqueue_gunicorn_host
:
127.0.0.1
xqueue_gunicorn_host
:
127.0.0.1
xqueue_user
:
"
xqueue"
xqueue_user_home
:
"
/opt/xqueue"
xqueue_venv_dir
:
"
{{
xqueue_user_home
}}/virtualenvs/{{
xqueue_user
}}"
XQUEUE_QUEUES
:
XQUEUE_QUEUES
:
# push queue
# push queue
'
edX-DemoX'
:
'
http://localhost:18050'
'
edX-DemoX'
:
'
http://localhost:18050'
...
...
playbooks/roles/xqueue/tasks/deploy.yml
View file @
57afc315
...
@@ -2,97 +2,72 @@
...
@@ -2,97 +2,72 @@
-
name
:
xqueue | stop xqueue service
-
name
:
xqueue | stop xqueue service
service
:
name=xqueue state=stopped
service
:
name=xqueue state=stopped
tags
:
tags
:
-
xqueue
-
deploy
-
deploy
-
name
:
xqueue | stop xqueue consumer service
-
name
:
xqueue | stop xqueue consumer service
service
:
name=xqueue_consumer state=stopped
service
:
name=xqueue_consumer state=stopped
tags
:
tags
:
-
xqueue
-
deploy
-
deploy
-
name
:
xqueue | create xqueue application config
-
name
:
xqueue | create xqueue application config
template
:
src=xqueue.env.json.j2 dest={{app_dir}}/xqueue.env.json mode=0640 owner={{ xqueue_user }} group=adm
template
:
src=xqueue.env.json.j2 dest={{xqueue_app_dir}}/xqueue.env.json mode=0640 owner={{ xqueue_user }} group=adm
sudo_user
:
"
{{
xqueue_user
}}"
tags
:
tags
:
-
xqueue
-
deploy
-
deploy
-
name
:
xqueue | create xqueue auth file
-
name
:
xqueue | create xqueue auth file
template
:
src=xqueue.auth.json.j2 dest={{app_dir}}/xqueue.auth.json mode=0640 owner={{ xqueue_user }} group=adm
template
:
src=xqueue.auth.json.j2 dest={{xqueue_app_dir}}/xqueue.auth.json mode=0640 owner={{ xqueue_user }} group=adm
sudo_user
:
"
{{
xqueue_user
}}"
tags
:
tags
:
-
xqueue
-
deploy
-
deploy
# Do A Checkout
# Do A Checkout
-
name
:
xqueue | git checkout xqueue repo into {{app_dir}}
-
name
:
xqueue | git checkout xqueue repo into {{app_dir}}
git
:
dest={{xqueue_code_dir}} repo={{xqueue_source_repo}} version={{xqueue_version}}
git
:
dest={{xqueue_code_dir}} repo={{xqueue_source_repo}} version={{xqueue_version}}
sudo_user
:
"
{{
xqueue_user
}}"
tags
:
tags
:
-
xqueue
-
deploy
-
deploy
# Do Post Checkout Tasks.
-
name
:
xqueue | create xqueue code dir
file
:
path={{xqueue_code_dir}} state=directory owner={{ xqueue_user }} group={{ xqueue_user }} mode=755
tags
:
-
xqueue
-
deploy
# TODO: Check git.py _run_if_changed() to see if the logic there to skip running certain
# portions of the deploy needs to be incorporated here.
-
name
:
xqueue | sets permissions on xqueue code dir and contents
file
:
path={{xqueue_code_dir}} state=directory owner={{ xqueue_user }} group={{ xqueue_user }} recurse=yes
# Post Checkout tasks will get run as handlers when the {{ xqueue_code_dir }} is ready.
# Look at the handlers/main.yml in this role for a description of the tasks stated below.
tags
:
-
xqueue
-
deploy
# Install the python pre requirements into {{ xqueue_venv_dir }}
# Install the python pre requirements into {{ xqueue_venv_dir }}
-
name
:
install python pre-requirements
-
name
:
install python pre-requirements
pip
:
requirements="{{xqueue_pre_requirements_file}}" virtualenv="{{xqueue_venv_dir}}" state=present
pip
:
requirements="{{xqueue_pre_requirements_file}}" virtualenv="{{xqueue_venv_dir}}" state=present
sudo_user
:
"
{{
xqueue_user
}}"
tags
:
tags
:
-
xqueue
-
deploy
-
deploy
# Install the python post requirements into {{ xqueue_venv_dir }}
# Install the python post requirements into {{ xqueue_venv_dir }}
-
name
:
install python post-requirements
-
name
:
install python post-requirements
pip
:
requirements="{{xqueue_post_requirements_file}}" virtualenv="{{xqueue_venv_dir}}" state=present
pip
:
requirements="{{xqueue_post_requirements_file}}" virtualenv="{{xqueue_venv_dir}}" state=present
sudo_user
:
"
{{
xqueue_user
}}"
tags
:
tags
:
-
xqueue
-
deploy
-
deploy
-
name
:
xqueue | syncdb and migrate
-
name
:
xqueue | syncdb and migrate
shell
:
sudo -u {{ xqueue_user }}
SERVICE_VARIANT=xqueue {{ xqueue_venv_dir }}/bin/django-admin.py syncdb --migrate --noinput --settings=xqueue.aws_settings --pythonpath=/opt/wwc/xqueue
shell
:
SERVICE_VARIANT=xqueue {{ xqueue_venv_dir }}/bin/django-admin.py syncdb --migrate --noinput --settings=xqueue.aws_settings --pythonpath=/opt/wwc/xqueue
when
:
migrate_db is defined and migrate_db|lower == "yes"
when
:
migrate_db is defined and migrate_db|lower == "yes"
sudo_user
:
"
{{
xqueue_user
}}"
tags
:
tags
:
-
xqueue
-
syncdb
-
deploy
-
deploy
-
name
:
xqueue | create users
-
name
:
xqueue | create users
shell
:
sudo -u {{ xqueue_user }}
SERVICE_VARIANT=xqueue {{ xqueue_venv_dir }}/bin/django-admin.py update_users --settings=xqueue.aws_settings --pythonpath=/opt/wwc/xqueue
shell
:
SERVICE_VARIANT=xqueue {{ xqueue_venv_dir }}/bin/django-admin.py update_users --settings=xqueue.aws_settings --pythonpath=/opt/wwc/xqueue
when
:
update_users is defined
when
:
update_users is defined
sudo_user
:
"
{{
xqueue_user
}}"
tags
:
tags
:
-
xqueue
-
syncdb
-
deploy
-
deploy
-
name
:
xqueue | stop xqueue
-
name
:
xqueue | stop xqueue
service
:
name=xqueue state=stopped
service
:
name=xqueue state=stopped
tags
:
tags
:
-
xqueue
-
deploy
-
deploy
-
name
:
xqueue | start xqueue
-
name
:
xqueue | start xqueue
service
:
name=xqueue state=started
service
:
name=xqueue state=started
tags
:
tags
:
-
xqueue
-
deploy
-
deploy
-
name
:
xqueue | start xqueue consumer
-
name
:
xqueue | start xqueue consumer
service
:
name=xqueue_consumer state=started
service
:
name=xqueue_consumer state=started
tags
:
tags
:
-
xqueue
-
deploy
-
deploy
playbooks/roles/xqueue/tasks/main.yml
View file @
57afc315
...
@@ -3,46 +3,30 @@
...
@@ -3,46 +3,30 @@
# - common/tasks/main.yml
# - common/tasks/main.yml
---
---
# Check out xqueue repo to {{xqueue_code_dir}}
# Check out xqueue repo to {{xqueue_code_dir}}
-
name
:
xqueue | install git and its recommends
#
apt
:
pkg=git state=present install_recommends=yes
#
tags
:
-
xqueue
-
name
:
xqueue | create application user
user
:
>
name="{{ xqueue_user }}"
home="{{ xqueue_app_dir }}"
createhome=no
shell=/bin/false
-
name
:
xqueue | create xqueue app dir
file
:
>
path="{{ xqueue_app_dir }}"
state=directory
owner="{{ xqueue_user }}"
group="{{ common_web_group }}"
-
name
:
xqueue | install a bunch of system packages on which xqueue relies
-
name
:
xqueue | install a bunch of system packages on which xqueue relies
apt
:
pkg={{','.join(xqueue_debian_pkgs)}} state=present
apt
:
pkg={{','.join(xqueue_debian_pkgs)}} state=present
notify
:
notify
:
-
xqueue | restart xqueue
-
xqueue | restart xqueue
-
xqueue | restart xqueue consumer
-
xqueue | restart xqueue consumer
tags
:
-
xqueue
-
name
:
xqueue | create {{ xqueue_user_home }}
# workaround for the case where the parent
# directory doesn't exist
file
:
>
path={{ xqueue_user_home }}
state=directory
-
name
:
xqueue | create xqueue user {{ xqueue_user }}
user
:
>
name={{ xqueue_user }}
state=present
shell=/bin/bash
home={{ xqueue_user_home }}
createhome=yes
tags
:
-
forum
-
update
-
name
:
xqueue | ensure homedir permissions {{ xqueue_user_home }}
# workaround for the case where the parent
# directory doesn't exist
file
:
>
path={{ xqueue_user_home }}
owner={{ xqueue_user }}
group={{ xqueue_user }}
state=directory
recurse=yes
-
name
:
xqueue | create xqueue db
-
name
:
xqueue | create xqueue db
mysql_db
:
>
mysql_db
:
>
...
@@ -56,17 +40,8 @@
...
@@ -56,17 +40,8 @@
-
name
:
xqueue | creating xqueue upstart script
-
name
:
xqueue | creating xqueue upstart script
template
:
src=xqueue.conf.j2 dest=/etc/init/xqueue.conf mode=0640 owner=root group=adm
template
:
src=xqueue.conf.j2 dest=/etc/init/xqueue.conf mode=0640 owner=root group=adm
tags
:
-
xqueue
-
deploy
-
name
:
xqueue | create xqueue consumer upstart script
-
name
:
xqueue | create xqueue consumer upstart script
template
:
src=xqueue_consumer.conf.j2 dest=/etc/init/xqueue_consumer.conf mode=0640 owner=root group=adm
template
:
src=xqueue_consumer.conf.j2 dest=/etc/init/xqueue_consumer.conf mode=0640 owner=root group=adm
tags
:
-
xqueue
-
deploy
-
include
:
deploy.yml
-
include
:
deploy.yml
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