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
78ba8aef
Commit
78ba8aef
authored
Oct 14, 2015
by
Edward Zarecor
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2345 from edx/e0d/tag-experiment-hackathon
E0d/tag experiment hackathon
parents
608d75b2
a71af77f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
121 additions
and
14 deletions
+121
-14
playbooks/roles/edx_service/tasks/main.yml
+39
-5
playbooks/roles/forum/tasks/deploy.yml
+21
-6
playbooks/roles/forum/tasks/main.yml
+15
-2
playbooks/roles/xqueue/tasks/deploy.yml
+37
-1
playbooks/roles/xqueue/tasks/main.yml
+9
-0
No files found.
playbooks/roles/edx_service/tasks/main.yml
View file @
78ba8aef
...
@@ -54,6 +54,9 @@
...
@@ -54,6 +54,9 @@
createhome=yes
createhome=yes
shell=/bin/false
shell=/bin/false
generate_ssh_key=yes
generate_ssh_key=yes
tags
:
-
install
-
install:base
# Assumes that the home directory has been created above.
# Assumes that the home directory has been created above.
# In some cases(vagrant boxes) the home directory gets created
# In some cases(vagrant boxes) the home directory gets created
...
@@ -72,6 +75,9 @@
...
@@ -72,6 +75,9 @@
-
"
venvs"
-
"
venvs"
-
"
data"
-
"
data"
-
"
staticfiles"
-
"
staticfiles"
tags
:
-
install
-
install:base
-
name
:
create /edx/var and /edx/etc dirs
-
name
:
create /edx/var and /edx/etc dirs
file
:
>
file
:
>
...
@@ -83,6 +89,9 @@
...
@@ -83,6 +89,9 @@
with_items
:
with_items
:
-
/edx/var
-
/edx/var
-
/edx/etc
-
/edx/etc
tags
:
-
install
-
install:base
-
name
:
create edx_service log dir
-
name
:
create edx_service log dir
file
:
>
file
:
>
...
@@ -92,36 +101,51 @@
...
@@ -92,36 +101,51 @@
group="syslog"
group="syslog"
with_items
:
with_items
:
-
"
{{
COMMON_LOG_DIR
}}/{{
edx_service_name
}}"
-
"
{{
COMMON_LOG_DIR
}}/{{
edx_service_name
}}"
tags
:
-
install
-
install:base
-
name
:
write out app config file
-
name
:
write out app config file
template
:
>
template
:
>
src=config.yml.j2
src=config.yml.j2
dest={{ COMMON_CFG_DIR }}/{{ edx_service_name }}.yml
dest={{ COMMON_CFG_DIR }}/{{ edx_service_name }}.yml
mode=0644
mode=0644
tags
:
-
deploy
when
:
edx_service_config is defined
when
:
edx_service_config is defined
tags
:
-
install
-
install:configuration
-
name
:
install a bunch of system packages on which edx_service relies
-
name
:
install a bunch of system packages on which edx_service relies
apt
:
pkg={{ item }} state=present
apt
:
pkg={{ item }} state=present
with_items
:
edx_service_packages.debian
with_items
:
edx_service_packages.debian
when
:
ansible_distribution in common_debian_variants
when
:
ansible_distribution in common_debian_variants
tags
:
-
install
-
install:system-requirements
-
name
:
install a bunch of system packages on which edx_service relies
-
name
:
install a bunch of system packages on which edx_service relies
yum
:
pkg={{ item }} state=present
yum
:
pkg={{ item }} state=present
with_items
:
edx_service_name.redhat
with_items
:
edx_service_name.redhat
when
:
ansible_distribution in common_redhat_variants
when
:
ansible_distribution in common_redhat_variants
tags
:
-
install
-
install:system-requirements
-
name
:
set git fetch.prune to ignore deleted remote refs
-
name
:
set git fetch.prune to ignore deleted remote refs
shell
:
git config --global fetch.prune
true
shell
:
git config --global fetch.prune
true
sudo_user
:
"
{{
edx_service_user
}}"
sudo_user
:
"
{{
edx_service_user
}}"
when
:
edx_service_repos is defined
when
:
edx_service_repos is defined
tags
:
-
install
-
install:code
-
name
:
validate git protocol
-
name
:
validate git protocol
fail
:
msg='REPOS.PROTOCOL must be "https" or "ssh"'
fail
:
msg='REPOS.PROTOCOL must be "https" or "ssh"'
when
:
(item.PROTOCOL != "https") and (item.PROTOCOL != "ssh") and edx_service_repos is defined
when
:
(item.PROTOCOL != "https") and (item.PROTOCOL != "ssh") and edx_service_repos is defined
with_items
:
edx_service_repos
with_items
:
edx_service_repos
tags
:
-
install
-
install:code
-
name
:
install read-only ssh key
-
name
:
install read-only ssh key
copy
:
>
copy
:
>
...
@@ -130,6 +154,9 @@
...
@@ -130,6 +154,9 @@
group={{ edx_service_user }} mode=0600
group={{ edx_service_user }} mode=0600
when
:
item.PROTOCOL == "ssh" and edx_service_repos is defined
when
:
item.PROTOCOL == "ssh" and edx_service_repos is defined
with_items
:
edx_service_repos
with_items
:
edx_service_repos
tags
:
-
install
-
install:code
-
name
:
checkout code over ssh
-
name
:
checkout code over ssh
git
:
>
git
:
>
...
@@ -140,6 +167,9 @@
...
@@ -140,6 +167,9 @@
register
:
code_checkout
register
:
code_checkout
when
:
item.PROTOCOL == "ssh" and edx_service_repos is defined
when
:
item.PROTOCOL == "ssh" and edx_service_repos is defined
with_items
:
edx_service_repos
with_items
:
edx_service_repos
tags
:
-
install
-
install:code
-
name
:
checkout code over https
-
name
:
checkout code over https
git
:
>
git
:
>
...
@@ -149,7 +179,9 @@
...
@@ -149,7 +179,9 @@
register
:
code_checkout
register
:
code_checkout
when
:
item.PROTOCOL == "https" and edx_service_repos is defined
when
:
item.PROTOCOL == "https" and edx_service_repos is defined
with_items
:
edx_service_repos
with_items
:
edx_service_repos
tags
:
-
install
-
install:code
-
name
:
get instance information
-
name
:
get instance information
action
:
ec2_facts
action
:
ec2_facts
...
@@ -165,5 +197,7 @@
...
@@ -165,5 +197,7 @@
with_together
:
with_together
:
-
edx_service_repos
-
edx_service_repos
-
code_checkout.results
-
code_checkout.results
tags
:
-
to-remove
#TODO: restart supervisor- depends on supervisor being refactored into this role
#TODO: restart supervisor- depends on supervisor being refactored into this role
playbooks/roles/forum/tasks/deploy.yml
View file @
78ba8aef
...
@@ -8,6 +8,9 @@
...
@@ -8,6 +8,9 @@
mode=0644
mode=0644
sudo_user
:
"
{{
supervisor_user
}}"
sudo_user
:
"
{{
supervisor_user
}}"
register
:
forum_supervisor
register
:
forum_supervisor
tags
:
-
install
-
install:configuration
-
name
:
enable the supervisor config
-
name
:
enable the supervisor config
file
:
>
file
:
>
...
@@ -20,7 +23,10 @@
...
@@ -20,7 +23,10 @@
sudo_user
:
"
{{
supervisor_user
}}"
sudo_user
:
"
{{
supervisor_user
}}"
when
:
not disable_edx_services
when
:
not disable_edx_services
register
:
forum_supervisor
register
:
forum_supervisor
tags
:
-
install
-
install:confugration
-
name
:
create the supervisor wrapper
-
name
:
create the supervisor wrapper
template
:
>
template
:
>
src={{ forum_supervisor_wrapper|basename }}.j2
src={{ forum_supervisor_wrapper|basename }}.j2
...
@@ -28,6 +34,9 @@
...
@@ -28,6 +34,9 @@
mode=0755
mode=0755
sudo_user
:
"
{{
forum_user
}}"
sudo_user
:
"
{{
forum_user
}}"
notify
:
restart the forum service
notify
:
restart the forum service
tags
:
-
install
-
install:configuration
-
name
:
git checkout forum repo into {{ forum_code_dir }}
-
name
:
git checkout forum repo into {{ forum_code_dir }}
git
:
>
git
:
>
...
@@ -36,6 +45,9 @@
...
@@ -36,6 +45,9 @@
sudo_user
:
"
{{
forum_user
}}"
sudo_user
:
"
{{
forum_user
}}"
register
:
forum_checkout
register
:
forum_checkout
notify
:
restart the forum service
notify
:
restart the forum service
tags
:
-
install
-
install:code
# TODO: This is done as the common_web_user
# TODO: This is done as the common_web_user
# since the process owner needs write access
# since the process owner needs write access
...
@@ -45,6 +57,9 @@
...
@@ -45,6 +57,9 @@
sudo_user
:
"
{{
common_web_user
}}"
sudo_user
:
"
{{
common_web_user
}}"
environment
:
"
{{
forum_environment
}}"
environment
:
"
{{
forum_environment
}}"
notify
:
restart the forum service
notify
:
restart the forum service
tags
:
-
install
-
install:code
# call supervisorctl update. this reloads
# call supervisorctl update. this reloads
# the supervisorctl config and restarts
# the supervisorctl config and restarts
...
@@ -56,6 +71,9 @@
...
@@ -56,6 +71,9 @@
register
:
supervisor_update
register
:
supervisor_update
changed_when
:
supervisor_update.stdout is defined and supervisor_update.stdout != ""
changed_when
:
supervisor_update.stdout is defined and supervisor_update.stdout != ""
when
:
not disable_edx_services
when
:
not disable_edx_services
tags
:
-
install
-
install:configuration
-
name
:
ensure forum is started
-
name
:
ensure forum is started
supervisorctl
:
>
supervisorctl
:
>
...
@@ -64,10 +82,7 @@
...
@@ -64,10 +82,7 @@
config={{ supervisor_cfg }}
config={{ supervisor_cfg }}
state=started
state=started
when
:
not disable_edx_services
when
:
not disable_edx_services
tags
:
-
include
:
test.yml tags=deploy
-
manage
-
include
:
tag_ec2.yml tags=deploy
when
:
COMMON_TAG_EC2_INSTANCE
-
set_fact
:
forum_installed=true
-
set_fact
:
forum_installed=true
playbooks/roles/forum/tasks/main.yml
View file @
78ba8aef
---
1;2802;0c
---
# forum
# forum
#
#
...
@@ -27,12 +27,18 @@
...
@@ -27,12 +27,18 @@
createhome=no
createhome=no
shell=/bin/false
shell=/bin/false
notify
:
restart the forum service
notify
:
restart the forum service
tags
:
-
install
-
install:base
-
name
:
create forum app dir
-
name
:
create forum app dir
file
:
>
file
:
>
path="{{ forum_app_dir }}" state=directory
path="{{ forum_app_dir }}" state=directory
owner="{{ forum_user }}" group="{{ common_web_group }}"
owner="{{ forum_user }}" group="{{ common_web_group }}"
notify
:
restart the forum service
notify
:
restart the forum service
tags
:
-
install
-
install:base
-
name
:
setup the forum env
-
name
:
setup the forum env
template
:
>
template
:
>
...
@@ -41,11 +47,17 @@
...
@@ -41,11 +47,17 @@
mode=0644
mode=0644
notify
:
notify
:
-
restart the forum service
-
restart the forum service
tags
:
-
install
-
install:base
-
name
:
create {{ forum_data_dir }}
-
name
:
create {{ forum_data_dir }}
file
:
>
file
:
>
path={{ forum_data_dir }} state=directory
path={{ forum_data_dir }} state=directory
owner="{{ common_web_user }}" group="{{ common_web_group }}"
owner="{{ common_web_user }}" group="{{ common_web_group }}"
mode=0777
mode=0777
tags
:
-
install
-
install:base
-
include
:
deploy.yml tags=deploy
-
include
:
deploy.yml tags=deploy
\ No newline at end of file
playbooks/roles/xqueue/tasks/deploy.yml
View file @
78ba8aef
...
@@ -3,6 +3,9 @@
...
@@ -3,6 +3,9 @@
src={{ item }}.conf.j2 dest={{ supervisor_available_dir }}/{{ item }}.conf
src={{ item }}.conf.j2 dest={{ supervisor_available_dir }}/{{ item }}.conf
owner={{ supervisor_user }} group={{ common_web_user }} mode=0644
owner={{ supervisor_user }} group={{ common_web_user }} mode=0644
with_items
:
[
'
xqueue'
,
'
xqueue_consumer'
]
with_items
:
[
'
xqueue'
,
'
xqueue_consumer'
]
tags
:
-
install
-
install:configuration
-
name
:
"
enabling
supervisor
scripts
-
xqueue,
xqueue
consumer"
-
name
:
"
enabling
supervisor
scripts
-
xqueue,
xqueue
consumer"
file
:
>
file
:
>
...
@@ -12,6 +15,9 @@
...
@@ -12,6 +15,9 @@
mode=0644 state=link force=yes
mode=0644 state=link force=yes
with_items
:
[
'
xqueue'
,
'
xqueue_consumer'
]
with_items
:
[
'
xqueue'
,
'
xqueue_consumer'
]
when
:
not disable_edx_services
when
:
not disable_edx_services
tags
:
-
install
-
install:configuration
-
name
:
"
add
gunicorn
configuration
file"
-
name
:
"
add
gunicorn
configuration
file"
template
:
>
template
:
>
...
@@ -19,18 +25,27 @@
...
@@ -19,18 +25,27 @@
sudo_user
:
"
{{
xqueue_user
}}"
sudo_user
:
"
{{
xqueue_user
}}"
notify
:
notify
:
-
restart xqueue
-
restart xqueue
tags
:
-
install
-
install:configuration
-
name
:
create xqueue application config
-
name
:
create xqueue application config
template
:
src=xqueue.env.json.j2 dest={{ xqueue_app_dir }}/xqueue.env.json mode=0644
template
:
src=xqueue.env.json.j2 dest={{ xqueue_app_dir }}/xqueue.env.json mode=0644
sudo_user
:
"
{{
xqueue_user
}}"
sudo_user
:
"
{{
xqueue_user
}}"
notify
:
notify
:
-
restart xqueue
-
restart xqueue
tags
:
-
install
-
install:configuration
-
name
:
create xqueue auth file
-
name
:
create xqueue auth file
template
:
src=xqueue.auth.json.j2 dest={{ xqueue_app_dir }}/xqueue.auth.json mode=0644
template
:
src=xqueue.auth.json.j2 dest={{ xqueue_app_dir }}/xqueue.auth.json mode=0644
sudo_user
:
"
{{
xqueue_user
}}"
sudo_user
:
"
{{
xqueue_user
}}"
notify
:
notify
:
-
restart xqueue
-
restart xqueue
tags
:
-
install
-
install:configuration
# Do A Checkout
# Do A Checkout
-
name
:
git checkout xqueue repo into xqueue_code_dir
-
name
:
git checkout xqueue repo into xqueue_code_dir
...
@@ -41,6 +56,9 @@
...
@@ -41,6 +56,9 @@
register
:
xqueue_checkout
register
:
xqueue_checkout
notify
:
notify
:
-
restart xqueue
-
restart xqueue
tags
:
-
install
-
install:code
# Install the python pre requirements into {{ xqueue_venv_dir }}
# Install the python pre requirements into {{ xqueue_venv_dir }}
...
@@ -51,6 +69,9 @@
...
@@ -51,6 +69,9 @@
sudo_user
:
"
{{
xqueue_user
}}"
sudo_user
:
"
{{
xqueue_user
}}"
notify
:
notify
:
-
restart xqueue
-
restart xqueue
tags
:
-
install
-
install:application-requirements
# 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
...
@@ -60,6 +81,9 @@
...
@@ -60,6 +81,9 @@
sudo_user
:
"
{{
xqueue_user
}}"
sudo_user
:
"
{{
xqueue_user
}}"
notify
:
notify
:
-
restart xqueue
-
restart xqueue
tags
:
-
install
-
install:application-requirements
# If there is a common user for migrations run migrations using his username
# If there is a common user for migrations run migrations using his username
# and credentials. If not we use the xqueue mysql user
# and credentials. If not we use the xqueue mysql user
...
@@ -73,6 +97,9 @@
...
@@ -73,6 +97,9 @@
when
:
migrate_db is defined and migrate_db|lower == "yes" and COMMON_MYSQL_MIGRATE_PASS
when
:
migrate_db is defined and migrate_db|lower == "yes" and COMMON_MYSQL_MIGRATE_PASS
notify
:
notify
:
-
restart xqueue
-
restart xqueue
tags
:
-
migrate
-
migrate:db
-
name
:
create users
-
name
:
create users
shell
:
>
shell
:
>
...
@@ -80,6 +107,9 @@
...
@@ -80,6 +107,9 @@
sudo_user
:
"
{{
xqueue_user
}}"
sudo_user
:
"
{{
xqueue_user
}}"
notify
:
notify
:
-
restart xqueue
-
restart xqueue
tags
:
-
manage
-
manage:app-users
# call supervisorctl update. this reloads
# call supervisorctl update. this reloads
# the supervisorctl config and restarts
# the supervisorctl config and restarts
...
@@ -91,7 +121,7 @@
...
@@ -91,7 +121,7 @@
register
:
supervisor_update
register
:
supervisor_update
changed_when
:
supervisor_update.stdout is defined and supervisor_update.stdout != ""
changed_when
:
supervisor_update.stdout is defined and supervisor_update.stdout != ""
when
:
not disable_edx_services
when
:
not disable_edx_services
-
name
:
ensure xqueue, consumer is running
-
name
:
ensure xqueue, consumer is running
supervisorctl
:
>
supervisorctl
:
>
name={{ item }}
name={{ item }}
...
@@ -102,6 +132,9 @@
...
@@ -102,6 +132,9 @@
-
xqueue
-
xqueue
-
xqueue_consumer
-
xqueue_consumer
when
:
not disable_edx_services
when
:
not disable_edx_services
tags
:
-
manage
-
manage:start
-
name
:
create a symlink for venv python
-
name
:
create a symlink for venv python
file
:
>
file
:
>
...
@@ -111,5 +144,8 @@
...
@@ -111,5 +144,8 @@
with_items
:
with_items
:
-
python
-
python
-
pip
-
pip
tags
:
-
install
-
install:base
-
set_fact
:
xqueue_installed=true
-
set_fact
:
xqueue_installed=true
playbooks/roles/xqueue/tasks/main.yml
View file @
78ba8aef
...
@@ -14,6 +14,9 @@
...
@@ -14,6 +14,9 @@
shell=/bin/false
shell=/bin/false
notify
:
notify
:
-
restart xqueue
-
restart xqueue
tags
:
-
install
-
install:base
-
name
:
create xqueue app and venv dir
-
name
:
create xqueue app and venv dir
file
:
>
file
:
>
...
@@ -26,11 +29,17 @@
...
@@ -26,11 +29,17 @@
with_items
:
with_items
:
-
"
{{
xqueue_app_dir
}}"
-
"
{{
xqueue_app_dir
}}"
-
"
{{
xqueue_venvs_dir
}}"
-
"
{{
xqueue_venvs_dir
}}"
tags
:
-
install
-
install:base
-
name
:
install a bunch of system packages on which xqueue relies
-
name
:
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
:
-
restart xqueue
-
restart xqueue
tags
:
-
install
-
install:system-requirements
-
include
:
deploy.yml tags=deploy
-
include
:
deploy.yml tags=deploy
...
...
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