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
689fe8df
Commit
689fe8df
authored
Oct 11, 2013
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moving all nginx templates into the nginx role
removing nginx setup from individual roles
parent
3b1faf4f
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
28 additions
and
93 deletions
+28
-93
playbooks/roles/discern/defaults/main.yml
+1
-1
playbooks/roles/discern/handlers/main.yml
+0
-3
playbooks/roles/discern/tasks/main.yml
+0
-17
playbooks/roles/edxapp/defaults/main.yml
+1
-2
playbooks/roles/edxapp/tasks/cms.yml
+0
-7
playbooks/roles/edxapp/tasks/lms-preview.yml
+0
-7
playbooks/roles/edxapp/tasks/lms.yml
+0
-6
playbooks/roles/edxapp/tasks/main.yml
+0
-1
playbooks/roles/edxlocal/tasks/main.yml
+0
-1
playbooks/roles/nginx/handlers/main.yml
+3
-1
playbooks/roles/nginx/tasks/main.yml
+7
-14
playbooks/roles/nginx/templates/basic-auth.j2
+1
-6
playbooks/roles/nginx/templates/cms.j2
+3
-0
playbooks/roles/nginx/templates/discern.j2
+1
-1
playbooks/roles/nginx/templates/edx-release.j2
+0
-2
playbooks/roles/nginx/templates/lms.j2
+11
-0
playbooks/roles/nginx/templates/xserver.j2
+0
-0
playbooks/roles/ora/tasks/deploy.yml
+0
-4
playbooks/roles/ora/tasks/main.yml
+0
-1
playbooks/roles/xqueue/tasks/deploy.yml
+0
-3
playbooks/roles/xqueue/tasks/main.yml
+0
-1
playbooks/roles/xserver/handlers/main.yml
+0
-4
playbooks/roles/xserver/tasks/main.yml
+0
-2
playbooks/roles/xserver/tasks/nginx.yml
+0
-9
No files found.
playbooks/roles/discern/defaults/main.yml
View file @
689fe8df
...
...
@@ -6,7 +6,7 @@ discern_settings: discern.aws
nltk_data_dir
:
/usr/share/nltk_data
ease_branch
:
master
discern_branch
:
dev
nginx_listen
_port
:
80
discern_nginx
_port
:
80
gunicorn_port
:
7999
discern_user
:
discern
site_name
:
discern
playbooks/roles/discern/handlers/main.yml
View file @
689fe8df
...
...
@@ -4,6 +4,3 @@
-
name
:
discern | restart celery
service
:
name=celery state=restarted
-
name
:
discern | restart nginx
service
:
name=nginx state=restarted
playbooks/roles/discern/tasks/main.yml
View file @
689fe8df
...
...
@@ -109,20 +109,3 @@
#Have this separate from the other three because it doesn't take the noinput flag
-
name
:
discern | django update_index for discern
shell
:
${venv_dir}/bin/python {{discern_dir}}/manage.py update_index --settings={{discern_settings}} --pythonpath={{discern_dir}}
-
name
:
discern | create nginx directory and set perms
file
:
path=/etc/nginx/sites-available owner=root group=edx mode=2775 state=directory
#Install nginx sites available
#remove default link, render template, link template to sites-enabled to activate
-
name
:
discern | Removing default nginx config
file
:
path=/etc/nginx/sites-enabled/default state=absent
notify
:
discern | restart nginx
-
name
:
discern | render nginx sites available
template
:
src=nginx-discern.j2 dest=/etc/nginx/sites-available/{{ site_name }}
notify
:
discern | restart nginx
-
name
:
discern | Creating nginx config link {{ site_name }}
file
:
src=/etc/nginx/sites-available/{{ site_name }} dest=/etc/nginx/sites-enabled/{{ site_name }} state=link owner=root group=root
notify
:
discern | restart nginx
playbooks/roles/edxapp/defaults/main.yml
View file @
689fe8df
...
...
@@ -249,8 +249,7 @@ edxapp_lms_preview_app_address: 127.0.0.1
# These vars are for creating the application json config
# files. There are two for each service that uses the
# 'edx-platform' code. Defining them will create the upstart
# job and nginx configuration for the corresponding service.
# It will also enable the corresponding section in the
# job. It will also enable the corresponding section in the
# 'edxapp' upstart job.
service_variants_enabled
:
...
...
playbooks/roles/edxapp/tasks/cms.yml
View file @
689fe8df
# requires:
# - group_vars/all
# - common/tasks/main.yml
# - nginx/tasks/main.yml
---
-
name
:
create cms application config
template
:
src=cms.env.json.j2 dest=$app_base_dir/cms.env.json mode=640 owner=www-data group=adm
...
...
@@ -19,12 +18,6 @@
-
update
-
deploy
-
include
:
../../nginx/tasks/nginx_site.yml state=link site_name=cms
when
:
celery_worker is not defined
-
include
:
../../nginx/tasks/nginx_site.yml state=link site_name=cms-backend
when
:
celery_worker is not defined
-
name
:
Create CMS log target directory
file
:
path={{log_base_dir}}/cms state=directory owner=syslog group=syslog mode=2750
tags
:
...
...
playbooks/roles/edxapp/tasks/lms-preview.yml
View file @
689fe8df
# requires:
# - group_vars/all
# - common/tasks/main.yml
# - nginx/tasks/main.yml
---
-
name
:
create lms application config
template
:
src=lms-preview.env.json.j2 dest=$app_base_dir/lms-preview.env.json mode=640 owner=www-data group=adm
...
...
@@ -26,11 +25,5 @@
-
update
-
deploy
-
include
:
../../nginx/tasks/nginx_site.yml state=link site_name=lms-preview
when
:
celery_worker is not defined
-
include
:
../../nginx/tasks/nginx_site.yml state=link site_name=lms-preview-backend
when
:
celery_worker is not defined
# Creates LMS Preview upstart file
-
include
:
upstart.yml basename=lms-preview
playbooks/roles/edxapp/tasks/lms.yml
View file @
689fe8df
...
...
@@ -24,12 +24,6 @@
-
update
-
deploy
-
include
:
../../nginx/tasks/nginx_site.yml state=link site_name=lms
when
:
celery_worker is not defined
-
include
:
../../nginx/tasks/nginx_site.yml state=link site_name=lms-backend
when
:
celery_worker is not defined
# Creates LMS upstart file
-
include
:
upstart.yml basename=lms
when
:
celery_worker is not defined
...
...
playbooks/roles/edxapp/tasks/main.yml
View file @
689fe8df
# requires:
# - group_vars/all
# - common/tasks/main.yml
# - nginx/tasks/main.yml
---
-
name
:
Change permissions on datadir
file
:
path={{ app_base_dir }}/data state=directory owner=www-data group=www-data
...
...
playbooks/roles/edxlocal/tasks/main.yml
View file @
689fe8df
...
...
@@ -2,7 +2,6 @@
# requires:
# - group_vars/all
# - common/tasks/main.yml
# - nginx/tasks/main.yml
#
# This installs mysql-server-5.5 though
# in production we use mysql-5.1.62.
...
...
playbooks/roles/nginx/handlers/main.yml
View file @
689fe8df
---
-
name
:
nginx | restart nginx
service
:
name=nginx state=restarted
sudo
:
True
-
name
:
nginx | reload nginx
service
:
name=nginx state=reloaded
playbooks/roles/nginx/tasks/main.yml
View file @
689fe8df
...
...
@@ -11,16 +11,13 @@
-
name
:
nginx | Server configuration file
copy
:
src={{secure_dir}}/files/nginx.conf dest=/etc/nginx/nginx.conf owner=root group=root mode=0644
when
:
nginx_conf is defined
notify
:
nginx | re
start
nginx
notify
:
nginx | re
load
nginx
tags
:
-
nginx
-
install
# Standard configuration that is common across all roles
# Default values for these variables are set in group_vars/all
# Note: remove spaces in {{..}}, otherwise you will get a template parsing error.
-
include
:
nginx_site.yml state={{nginx_cfg.sites_enabled.edx_release}} site_name=edx-release
-
include
:
nginx_site.yml state={{nginx_cfg.sites_enabled.basic_auth}} site_name=basic-auth
# Default configuration that is common across all roles
-
include
:
nginx_site.yml state=link site_name=edx-release
-
name
:
nginx | Write out default htpasswd file
copy
:
content={{ nginx_cfg.htpasswd }} dest=/etc/nginx/nginx.htpasswd owner=www-data group=www-data mode=0600
...
...
@@ -38,7 +35,7 @@
# removing default link
-
name
:
nginx | Removing default nginx config and restart (enabled)
file
:
path=/etc/nginx/sites-enabled/default state=absent
notify
:
nginx | re
start
nginx
notify
:
nginx | re
load
nginx
tags
:
-
nginx
-
update
...
...
@@ -47,29 +44,25 @@
-
name
:
nginx | Set up nginx access log rotation
template
:
dest=/etc/logrotate.d/nginx-access src=edx_logrotate_nginx_access.j2 owner=root group=root mode=644
notify
:
common | restart logrotate
tags
:
-
logging
-
update
-
name
:
nginx | Set up nginx access log rotation
template
:
dest=/etc/logrotate.d/nginx-error src=edx_logrotate_nginx_error.j2 owner=root group=root mode=644
notify
:
common | restart logrotate
tags
:
-
logging
-
update
-
name
:
nginx | Removing default nginx config (available)
file
:
path=/etc/nginx/sites-available/default state=absent
notify
:
nginx | reload nginx
tags
:
-
nginx
-
update
-
name
:
nginx | Register the fact that nginx has run
command
:
echo True
register
:
nginx_role_run
tags
:
-
nginx
-
update
# If tasks that notify restart nginx don't change the state of the remote system
# their corresponding notifications don't get run. If nginx has been stopped for
# any reason, this will ensure that it is started up again.
...
...
playbooks/roles/nginx/templates/basic-auth.j2
View file @
689fe8df
server {
listen 80;
location / {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/nginx.htpasswd;
root {{
app_base_dir
}}/main_static;
root {{
app_base_dir
}}/main_static;
index index.html
proxy_set_header X-Forwarded-Proto https;
}
}
playbooks/roles/nginx/templates/cms.j2
View file @
689fe8df
...
...
@@ -31,6 +31,9 @@ server {
}
location / {
{% if EDXAPP_LMS_BASIC_AUTH %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_cms_app;
}
...
...
playbooks/roles/
discern/templates/nginx-
discern.j2
→
playbooks/roles/
nginx/templates/
discern.j2
View file @
689fe8df
server {
listen {{
nginx_listen
_port}};
listen {{
discern_nginx
_port}};
server_name localhost;
set $my_host $http_host;
...
...
playbooks/roles/nginx/templates/edx-release.j2
View file @
689fe8df
server {
listen 8099 default_server;
server_name mitx_release.*;
location = /versions.html {
alias {{ nginx_cfg.version_html }};
}
...
...
playbooks/roles/nginx/templates/lms.j2
View file @
689fe8df
...
...
@@ -28,8 +28,19 @@ server {
proxy_redirect off;
proxy_pass http://lms-backend;
}
location / {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/nginx.htpasswd;
root {{app_base_dir}}/main_static;
index index.html
proxy_set_header X-Forwarded-Proto https;
}
location / {
{% if EDXAPP_LMS_BASIC_AUTH %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_lms_app;
}
...
...
playbooks/roles/
xserver/templates/simple-proxy
.j2
→
playbooks/roles/
nginx/templates/xserver
.j2
View file @
689fe8df
File moved
playbooks/roles/ora/tasks/deploy.yml
View file @
689fe8df
...
...
@@ -53,10 +53,6 @@
-
ora
-
deploy
# Install nginx site
-
include
:
../../nginx/tasks/nginx_site.yml state=link site_name=ora
# Do A Checkout
-
name
:
ora | git checkout ora repo into $app_base_dir
git
:
dest={{ora_code_dir}} repo={{ora_source_repo}} version={{ora_version}}
...
...
playbooks/roles/ora/tasks/main.yml
View file @
689fe8df
# requires:
# - group_vars/all
# - common/tasks/main.yml
# - nginx/tasks/main.yml
---
-
name
:
ora | create the ora application user
user
:
name={{ ora_user }}
...
...
playbooks/roles/xqueue/tasks/deploy.yml
View file @
689fe8df
...
...
@@ -35,9 +35,6 @@
-
xqueue
-
deploy
# Install nginx site
-
include
:
../../nginx/tasks/nginx_site.yml state=link site_name=xqueue
# Do A Checkout
-
name
:
xqueue | git checkout xqueue repo into {{app_base_dir}}
git
:
dest={{xqueue_code_dir}} repo={{xqueue_source_repo}} version={{xqueue_version}}
...
...
playbooks/roles/xqueue/tasks/main.yml
View file @
689fe8df
# requires:
# - group_vars/all
# - common/tasks/main.yml
# - nginx/tasks/main.yml
---
# Check out xqueue repo to {{xqueue_code_dir}}
-
name
:
xqueue | install git and its recommends
...
...
playbooks/roles/xserver/handlers/main.yml
deleted
100644 → 0
View file @
3b1faf4f
-
name
:
xserver | restart nginx
service
:
name=nginx state=restarted
playbooks/roles/xserver/tasks/main.yml
View file @
689fe8df
...
...
@@ -53,6 +53,4 @@
-
name
:
xserver | upload ssh script
copy
:
src=git_ssh.sh dest=/tmp/git_ssh.sh force=yes owner=root group=adm mode=750
-
include
:
nginx.yml
-
include
:
deploy.yml
playbooks/roles/xserver/tasks/nginx.yml
deleted
100644 → 0
View file @
3b1faf4f
-
name
:
xserver | add xserver nginx configuration
template
:
src=simple-proxy.j2 dest=/etc/nginx/sites-available/simple-proxy
notify
:
-
xserver | restart nginx
-
name
:
xserver | enable xserver nginx configuration
file
:
src=/etc/nginx/sites-available/simple-proxy dest=/etc/nginx/sites-enabled/simple-proxy state=link
notify
:
-
xserver | restart nginx
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