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
3b507cf9
Commit
3b507cf9
authored
Feb 05, 2015
by
Max Rothman
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1802 from edx/max/dash2underscore
Convert dashes to underscores
parents
d7947fdb
983b0359
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
52 deletions
+47
-52
playbooks/roles/edx_notes_api/defaults/main.yml
+12
-20
playbooks/roles/edx_notes_api/meta/main.yml
+1
-2
playbooks/roles/edx_notes_api/tasks/main.yml
+6
-6
playbooks/roles/edx_notes_api/templates/edx/app/edx_notes_api/edx_notes_api_gunicorn.py.j2
+0
-0
playbooks/roles/edx_notes_api/templates/edx/app/supervisor/conf.d.available/edx_notes_api.conf.j2
+2
-1
playbooks/roles/edx_service/tasks/main.yml
+24
-21
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/edx_notes_api.j2
+2
-2
No files found.
playbooks/roles/edx
-notes-
api/defaults/main.yml
→
playbooks/roles/edx
_notes_
api/defaults/main.yml
View file @
3b507cf9
...
@@ -15,7 +15,7 @@ EDX_NOTES_API_GUNICORN_WORKERS_EXTRA: ""
...
@@ -15,7 +15,7 @@ EDX_NOTES_API_GUNICORN_WORKERS_EXTRA: ""
EDX_NOTES_API_WORKERS_EXTRA_CONF
:
"
"
EDX_NOTES_API_WORKERS_EXTRA_CONF
:
"
"
EDX_NOTES_API_LANG
:
en-us
EDX_NOTES_API_LANG
:
en-us
EDX_NOTES_API_WORKERS
:
!!null
EDX_NOTES_API_WORKERS
:
!!null
EDX_NOTES_API_DATASTORE_NAME
:
edx-notes-api
EDX_NOTES_API_DATASTORE_NAME
:
"
{{
edx_notes_api_service_name
}}"
EDX_NOTES_API_MYSQL_DB_USER
:
notes001
EDX_NOTES_API_MYSQL_DB_USER
:
notes001
EDX_NOTES_API_MYSQL_DB_NAME
:
"
{{
EDX_NOTES_API_DATASTORE_NAME
}}"
EDX_NOTES_API_MYSQL_DB_NAME
:
"
{{
EDX_NOTES_API_DATASTORE_NAME
}}"
EDX_NOTES_API_MYSQL_DB_PASS
:
secret
EDX_NOTES_API_MYSQL_DB_PASS
:
secret
...
@@ -24,8 +24,8 @@ EDX_NOTES_API_ELASTICSEARCH_URL: http://127.0.0.1:9200
...
@@ -24,8 +24,8 @@ EDX_NOTES_API_ELASTICSEARCH_URL: http://127.0.0.1:9200
EDX_NOTES_API_NEWRELIC_APPNAME
:
"
{{
COMMON_ENVIRONMENT
}}-{{
COMMON_DEPLOYMENT
}}-notes"
EDX_NOTES_API_NEWRELIC_APPNAME
:
"
{{
COMMON_ENVIRONMENT
}}-{{
COMMON_DEPLOYMENT
}}-notes"
# Change these values!!
# Change these values!!
EDX_NOTES_API_SECRET_KEY
:
"
i^,9%i=e=y/Nlpb=Mkx!j&,HD9d/17F][9P,FLdwM2+G6|]BEU"
EDX_NOTES_API_SECRET_KEY
:
"
i^,9%i=e=y/Nlpb=Mkx!j&,HD9d/17F][9P,FLdwM2+G6|]BEU"
EDX_NOTES_API_CLIENT_ID
:
edx
-notes-
id
EDX_NOTES_API_CLIENT_ID
:
edx
_notes_
id
EDX_NOTES_API_CLIENT_SECRET
:
edx
-notes-
secret
EDX_NOTES_API_CLIENT_SECRET
:
edx
_notes_
secret
EDX_NOTES_API_GIT_SSH_KEY
:
!!null
EDX_NOTES_API_GIT_SSH_KEY
:
!!null
EDX_NOTES_API_DATABASES
:
EDX_NOTES_API_DATABASES
:
...
@@ -41,12 +41,12 @@ EDX_NOTES_API_ALLOWED_HOSTS:
...
@@ -41,12 +41,12 @@ EDX_NOTES_API_ALLOWED_HOSTS:
-
localhost
-
localhost
EDX_NOTES_API_REPOS
:
EDX_NOTES_API_REPOS
:
-
PROTOCOL
:
"
{{
COMMON_GIT_PROTOCOL
}}"
-
PROTOCOL
:
"
{{
COMMON_GIT_PROTOCOL
}}"
DOMAIN
:
"
{{
COMMON_GIT_MIRROR
}}"
DOMAIN
:
"
{{
COMMON_GIT_MIRROR
}}"
PATH
:
"
{{
COMMON_GIT_PATH
}}"
PATH
:
"
{{
COMMON_GIT_PATH
}}"
REPO
:
edx-notes-api.git
REPO
:
edx-notes-api.git
VERSION
:
e0d/migration-overrides
VERSION
:
master
DESTINATION
:
"
{{
edx_notes_api_code_dir
}}"
DESTINATION
:
"
{{
edx_notes_api_code_dir
}}"
SSH_KEY
:
"
{{
EDX_NOTES_API_GIT_SSH_KEY
}}"
SSH_KEY
:
"
{{
EDX_NOTES_API_GIT_SSH_KEY
}}"
#
#
...
@@ -61,7 +61,7 @@ edx_notes_api_service_config:
...
@@ -61,7 +61,7 @@ edx_notes_api_service_config:
CLIENT_ID
:
"
{{
EDX_NOTES_API_CLIENT_ID
}}"
CLIENT_ID
:
"
{{
EDX_NOTES_API_CLIENT_ID
}}"
CLIENT_SECRET
:
"
{{
EDX_NOTES_API_CLIENT_SECRET
}}"
CLIENT_SECRET
:
"
{{
EDX_NOTES_API_CLIENT_SECRET
}}"
ELASTICSEARCH_URL
:
"
{{
EDX_NOTES_API_ELASTICSEARCH_URL
}}"
ELASTICSEARCH_URL
:
"
{{
EDX_NOTES_API_ELASTICSEARCH_URL
}}"
ELASTICSEARCH_INDEX
:
"
edx
-
notes"
ELASTICSEARCH_INDEX
:
"
edx
_
notes"
# Number of rows to return by default in result.
# Number of rows to return by default in result.
RESULTS_DEFAULT_SIZE
:
25
RESULTS_DEFAULT_SIZE
:
25
# Max number of rows to return in result.
# Max number of rows to return in result.
...
@@ -79,18 +79,10 @@ edx_notes_api_service_config:
...
@@ -79,18 +79,10 @@ edx_notes_api_service_config:
#
#
# vars are namespace with the module name.
# vars are namespace with the module name.
#
#
edx_notes_api_code_dir
:
"
{{
edx_notes_api_app_dir
}}/edx-notes-api"
edx_notes_api_service_name
:
edx_notes_api
edx_notes_api_role_name
:
edx-notes-api
edx_notes_api_user
:
"
{{
edx_notes_api_service_name
}}"
edx_notes_api_service_name
:
"
{{
edx_notes_api_role_name
}}"
# underscore name
edx_notes_api_role_name_safe
:
"
{{
edx_notes_api_role_name.replace('-',
'_')
}}"
edx_notes_api_source_repo
:
https://{{ COMMON_GIT_MIRROR }}/edx/edx-notes-api.git
edx_notes_api_user
:
"
{{
edx_notes_api_role_name
}}"
edx_notes_api_app_dir
:
"
{{
COMMON_APP_DIR
}}/{{
edx_notes_api_service_name
}}"
edx_notes_api_home
:
"
{{
COMMON_APP_DIR
}}/{{
edx_notes_api_service_name
}}"
edx_notes_api_home
:
"
{{
COMMON_APP_DIR
}}/{{
edx_notes_api_service_name
}}"
edx_notes_api_
python_path
:
"
{{
edx_notes_api_code_dir
}}/edx-notes-api
"
edx_notes_api_
code_dir
:
"
{{
edx_notes_api_home
}}/{{
edx_notes_api_service_name
}}
"
edx_notes_api_conf_dir
:
"
{{
edx_notes_api_home
}}"
edx_notes_api_conf_dir
:
"
{{
edx_notes_api_home
}}"
edx_notes_api_gunicorn_host
:
"
127.0.0.1"
edx_notes_api_gunicorn_host
:
"
127.0.0.1"
...
...
playbooks/roles/edx
-notes-
api/meta/main.yml
→
playbooks/roles/edx
_notes_
api/meta/main.yml
View file @
3b507cf9
...
@@ -21,10 +21,9 @@
...
@@ -21,10 +21,9 @@
dependencies
:
dependencies
:
-
role
:
edx_service
-
role
:
edx_service
edx_role_name
:
"
{{
edx_notes_api_role_name
}}"
edx_service_name
:
"
{{
edx_notes_api_service_name
}}"
edx_service_name
:
"
{{
edx_notes_api_service_name
}}"
edx_service_config
:
"
{{
edx_notes_api_service_config
}}"
edx_service_config
:
"
{{
edx_notes_api_service_config
}}"
edx_service_repos
:
"
{{
edx_notes_api_repos
}}"
edx_service_repos
:
"
{{
EDX_NOTES_API_REPOS
}}"
edx_service_user
:
"
{{
edx_notes_api_user
}}"
edx_service_user
:
"
{{
edx_notes_api_user
}}"
edx_service_home
:
"
{{
edx_notes_api_home
}}"
edx_service_home
:
"
{{
edx_notes_api_home
}}"
-
supervisor
-
supervisor
playbooks/roles/edx
-notes-
api/tasks/main.yml
→
playbooks/roles/edx
_notes_
api/tasks/main.yml
View file @
3b507cf9
...
@@ -47,8 +47,8 @@
...
@@ -47,8 +47,8 @@
-
name
:
install application requirements
-
name
:
install application requirements
pip
:
>
pip
:
>
requirements="{{ edx_notes_api_requirements_base }}/{{ item }}"
requirements="{{ edx_notes_api_requirements_base }}/{{ item }}"
virtualenv="{{ edx_notes_api_home }}/venvs
" state=present
virtualenv="{{ edx_notes_api_home }}/venvs
/{{ edx_notes_api_service_name }}"
extra_args="--exists-action w"
state=present
extra_args="--exists-action w"
sudo_user
:
"
{{
edx_notes_api_user
}}"
sudo_user
:
"
{{
edx_notes_api_user
}}"
with_items
:
edx_notes_api_requirements
with_items
:
edx_notes_api_requirements
...
@@ -65,8 +65,8 @@
...
@@ -65,8 +65,8 @@
-
name
:
write out gunicorn.py
-
name
:
write out gunicorn.py
template
:
>
template
:
>
src=edx/app/edx
-notes-api/{{ edx_notes_api_service_name }}-
gunicorn.py.j2
src=edx/app/edx
_notes_api/edx_notes_api_
gunicorn.py.j2
dest={{ edx_notes_api_
app_dir }}/{{ edx_notes_api_service_name }}-
gunicorn.py
dest={{ edx_notes_api_
home }}/{{ edx_notes_api_service_name }}_
gunicorn.py
mode=0650 owner={{ supervisor_user }} group={{ common_web_user }}
mode=0650 owner={{ supervisor_user }} group={{ common_web_user }}
tags
:
tags
:
-
deploy
-
deploy
...
@@ -108,7 +108,7 @@
...
@@ -108,7 +108,7 @@
-
name
:
create symlinks from the venv bin dir
-
name
:
create symlinks from the venv bin dir
file
:
>
file
:
>
src="{{ edx_notes_api_home }}/venvs/{{ edx_notes_api_service_name }}/bin/{{ item }}"
src="{{ edx_notes_api_home }}/venvs/{{ edx_notes_api_service_name }}/bin/{{ item }}"
dest="{{ COMMON_BIN_DIR }}/{{ item.split('.')[0] }}.{{ edx_notes_api_
rol
e_name }}"
dest="{{ COMMON_BIN_DIR }}/{{ item.split('.')[0] }}.{{ edx_notes_api_
servic
e_name }}"
state=link
state=link
with_items
:
with_items
:
-
python
-
python
...
@@ -118,5 +118,5 @@
...
@@ -118,5 +118,5 @@
-
name
:
create manage.py symlink
-
name
:
create manage.py symlink
file
:
>
file
:
>
src="{{ edx_notes_api_manage }}"
src="{{ edx_notes_api_manage }}"
dest="{{ COMMON_BIN_DIR }}/manage.{{ edx_notes_api_
rol
e_name }}"
dest="{{ COMMON_BIN_DIR }}/manage.{{ edx_notes_api_
servic
e_name }}"
state=link
state=link
playbooks/roles/edx
-notes-api/templates/edx/app/edx-notes-api/edx-notes-api-
gunicorn.py.j2
→
playbooks/roles/edx
_notes_api/templates/edx/app/edx_notes_api/edx_notes_api_
gunicorn.py.j2
View file @
3b507cf9
File moved
playbooks/roles/edx
-notes-
api/templates/edx/app/supervisor/conf.d.available/edx_notes_api.conf.j2
→
playbooks/roles/edx
_notes_
api/templates/edx/app/supervisor/conf.d.available/edx_notes_api.conf.j2
View file @
3b507cf9
[program:{{ edx_notes_api_service_name }}]
[program:{{ edx_notes_api_service_name }}]
{% set edx_notes_api_venv_bin = edx_notes_api_home + '/venvs/' + edx_notes_api_service_name + '/bin' %}
{% if COMMON_ENABLE_NEWRELIC_APP %}
{% if COMMON_ENABLE_NEWRELIC_APP %}
{% set executable = edx_notes_api_venv_bin + '/newrelic-admin run-program ' + edx_notes_api_venv_bin + '/gunicorn' %}
{% set executable = edx_notes_api_venv_bin + '/newrelic-admin run-program ' + edx_notes_api_venv_bin + '/gunicorn' %}
{% else %}
{% else %}
{% set executable = edx_notes_api_venv_bin + '/gunicorn' %}
{% set executable = edx_notes_api_venv_bin + '/gunicorn' %}
{% endif %}
{% endif %}
command={{ executable }} -c {{ edx_notes_api_
app_dir }}/edx-notes-api-
gunicorn.py {{ EDX_NOTES_API_GUNICORN_WORKERS_EXTRA }} {{ edx_notes_api_wsgi }}
command={{ executable }} -c {{ edx_notes_api_
home }}/edx_notes_api_
gunicorn.py {{ EDX_NOTES_API_GUNICORN_WORKERS_EXTRA }} {{ edx_notes_api_wsgi }}
user={{ common_web_user }}
user={{ common_web_user }}
directory={{ edx_notes_api_code_dir }}
directory={{ edx_notes_api_code_dir }}
...
...
playbooks/roles/edx_service/tasks/main.yml
View file @
3b507cf9
...
@@ -24,7 +24,21 @@
...
@@ -24,7 +24,21 @@
# depency definition.
# depency definition.
#
#
# dependencies:
# dependencies:
# - { role: edx_service, edx_service_name: "hotg" }
# - role: edx_service
# edx_service_name: "hotg"
# edx_service_config: "{{ structure_to_be_written_to_config_file_in_/edx/etc }}"
# edx_service_repos:
# - PROTOCOL: [https/ssh]
# DOMAIN: github.com
# PATH: edx
# REPO: hotg
# VERSION: master
# DESTINATION: "/edx/app/hotg/hotg"
# SSH_KEY: <required if PROTOCOL==ssh>
# - PROTOCOL
# ...
# edx_service_user: hotg_system_user
# edx_service_home: "/edx/app/hotg"
#
#
# Generating an ssh key so service users can do a git
# Generating an ssh key so service users can do a git
...
@@ -70,6 +84,7 @@
...
@@ -70,6 +84,7 @@
# Replace dashes with underscores to support roles that use
# Replace dashes with underscores to support roles that use
# dashes (the role vars will contain underscores)
# dashes (the role vars will contain underscores)
#TODO: REMOVE UNDERSCORE-TO-DASH CONVERSION ONCE ALL ROLES ARE NORMALIZED
-
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_name.replace('-',
'_')
}}_debian_pkgs"
with_items
:
"
{{
edx_service_name.replace('-',
'_')
}}_debian_pkgs"
...
@@ -81,21 +96,9 @@
...
@@ -81,21 +96,9 @@
when
:
ansible_distribution in common_redhat_variants
when
:
ansible_distribution in common_redhat_variants
-
name
:
check if git repo exists before pruning
-
name
:
set git fetch.prune to ignore deleted remote refs
stat
:
path={{ item.DESTINATION }}/.git
shell
:
git config --global fetch.prune
true
register
:
git_dir_exists
sudo_user
:
"
{{
edx_service_user
}}"
with_items
:
edx_service_repos
-
name
:
git prune before checking out
shell
:
cd {{ item.0.DESTINATION }} && git remote prune origin
sudo_user
:
"
{{
edx_service_name
}}"
when
:
>
(item.1.stat.exists) and
(item.1.stat.isdir is defined) and
item.1.stat.isdir
with_together
:
-
edx_service_repos
-
git_dir_exists.results
-
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"'
...
@@ -104,7 +107,7 @@
...
@@ -104,7 +107,7 @@
-
name
:
install read-only ssh key
-
name
:
install read-only ssh key
copy
:
>
copy
:
>
dest="{{ edx_service_home }}.ssh/{{ item.REPO }}"
dest="{{ edx_service_home }}
/
.ssh/{{ item.REPO }}"
content="{{ item.SSH_KEY }}" owner={{ edx_service_user }}
content="{{ item.SSH_KEY }}" owner={{ edx_service_user }}
group={{ edx_service_user }} mode=0600
group={{ edx_service_user }} mode=0600
when
:
item.PROTOCOL == "ssh"
when
:
item.PROTOCOL == "ssh"
...
@@ -114,8 +117,8 @@
...
@@ -114,8 +117,8 @@
git
:
>
git
:
>
repo=git@{{ item.DOMAIN }}:{{ item.PATH }}/{{ item.REPO }}
repo=git@{{ item.DOMAIN }}:{{ item.PATH }}/{{ item.REPO }}
dest={{ item.DESTINATION }} version={{ item.VERSION }}
dest={{ item.DESTINATION }} version={{ item.VERSION }}
accept_hostkey=yes key_file={{ edx_service_home }}.ssh/{{ item.REPO }}
accept_hostkey=yes key_file={{ edx_service_home }}
/
.ssh/{{ item.REPO }}
sudo_user
:
"
{{
edx_
role_name
}}"
sudo_user
:
"
{{
edx_
service_user
}}"
register
:
code_checkout
register
:
code_checkout
when
:
item.PROTOCOL == "ssh"
when
:
item.PROTOCOL == "ssh"
with_items
:
edx_service_repos
with_items
:
edx_service_repos
...
@@ -124,7 +127,7 @@
...
@@ -124,7 +127,7 @@
git
:
>
git
:
>
repo=https://{{ item.DOMAIN }}/{{ item.PATH }}/{{ item.REPO }}
repo=https://{{ item.DOMAIN }}/{{ item.PATH }}/{{ item.REPO }}
dest={{ item.DESTINATION }} version={{ item.VERSION }}
dest={{ item.DESTINATION }} version={{ item.VERSION }}
sudo_user
:
"
{{
edx_
role_name
}}"
sudo_user
:
"
{{
edx_
service_user
}}"
register
:
code_checkout
register
:
code_checkout
when
:
item.PROTOCOL == "https"
when
:
item.PROTOCOL == "https"
with_items
:
edx_service_repos
with_items
:
edx_service_repos
...
@@ -139,7 +142,7 @@
...
@@ -139,7 +142,7 @@
args
:
args
:
tags
:
tags
:
"
version:{{edx_service_name}}"
:
"
{{
item.0.DOMAIN
}}/{{
item.0.PATH
}}/{{
item.0.REPO
}}
{{
item.1.after
|truncate(7,True,'')
}}"
"
version:{{edx_service_name}}"
:
"
{{
item.0.DOMAIN
}}/{{
item.0.PATH
}}/{{
item.0.REPO
}}
{{
item.1.after
|truncate(7,True,'')
}}"
when
:
item.1.after is defined
when
:
item.1.after is defined
and ansible_ec2_instance_id is defined
with_together
:
with_together
:
-
edx_service_repos
-
edx_service_repos
-
code_checkout.results
-
code_checkout.results
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/edx
-notes-
api.j2
→
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/edx
_notes_
api.j2
View file @
3b507cf9
upstream {{ edx_notes_api_
role_name_saf
e }}_app_server {
upstream {{ edx_notes_api_
service_nam
e }}_app_server {
{% for host in nginx_edx_notes_api_gunicorn_hosts %}
{% for host in nginx_edx_notes_api_gunicorn_hosts %}
server {{ host }}:{{ edx_notes_api_gunicorn_port }} fail_timeout=0;
server {{ host }}:{{ edx_notes_api_gunicorn_port }} fail_timeout=0;
{% endfor %}
{% endfor %}
...
@@ -20,7 +20,7 @@ location @proxy_to_app {
...
@@ -20,7 +20,7 @@ location @proxy_to_app {
proxy_set_header Host $http_host;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_redirect off;
proxy_pass http://{{ edx_notes_api_
role_name_saf
e }}_app_server;
proxy_pass http://{{ edx_notes_api_
service_nam
e }}_app_server;
}
}
}
}
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