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
a13d32e4
Commit
a13d32e4
authored
8 years ago
by
Max Rothman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up some old nginx cruft
parent
d89d315f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
140 deletions
+12
-140
playbooks/roles/nginx/tasks/main.yml
+12
-129
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/edx-release.j2
+0
-11
No files found.
playbooks/roles/nginx/tasks/main.yml
View file @
a13d32e4
# requires:
# - common/tasks/main.yml
---
-
name
:
Create nginx app and data dirs
-
name
:
Create nginx app and data dirs
file
:
file
:
path
:
"
{{
item.path
}}"
path
:
"
{{
item.path
}}"
...
@@ -8,13 +5,13 @@
...
@@ -8,13 +5,13 @@
owner
:
"
{{
item.owner
}}"
owner
:
"
{{
item.owner
}}"
group
:
"
{{
item.group
}}"
group
:
"
{{
item.group
}}"
with_items
:
with_items
:
-
{
path
:
'
{{
nginx_app_dir
}}'
,
owner
:
'
{{
nginx_user
}}'
,
group
:
'
{{
common_web_group
}}'
}
-
{
path
:
'
{{
nginx_app_dir
}}'
,
owner
:
'
{{
nginx_user
}}'
,
group
:
'
{{
common_web_group
}}'
}
-
{
path
:
'
{{
nginx_sites_available_dir
}}'
,
owner
:
'
{{
nginx_user
}}'
,
group
:
'
{{
common_web_group
}}'
}
-
{
path
:
'
{{
nginx_sites_available_dir
}}'
,
owner
:
'
{{
nginx_user
}}'
,
group
:
'
{{
common_web_group
}}'
}
-
{
path
:
'
{{
nginx_sites_enabled_dir
}}'
,
owner
:
'
{{
nginx_user
}}'
,
group
:
'
{{
common_web_group
}}'
}
-
{
path
:
'
{{
nginx_sites_enabled_dir
}}'
,
owner
:
'
{{
nginx_user
}}'
,
group
:
'
{{
common_web_group
}}'
}
-
{
path
:
'
{{
nginx_conf_dir
}}'
,
owner
:
'
{{
nginx_user
}}'
,
group
:
'
{{
common_web_group
}}'
}
-
{
path
:
'
{{
nginx_conf_dir
}}'
,
owner
:
'
{{
nginx_user
}}'
,
group
:
'
{{
common_web_group
}}'
}
-
{
path
:
'
{{
nginx_data_dir
}}'
,
owner
:
'
{{
common_web_user
}}'
,
group
:
'
{{
nginx_user
}}'
}
-
{
path
:
'
{{
nginx_data_dir
}}'
,
owner
:
'
{{
common_web_user
}}'
,
group
:
'
{{
nginx_user
}}'
}
-
{
path
:
'
{{
nginx_log_dir
}}'
,
owner
:
'
{{
common_web_user
}}'
,
group
:
'
{{
nginx_user
}}'
}
-
{
path
:
'
{{
nginx_log_dir
}}'
,
owner
:
'
{{
common_web_user
}}'
,
group
:
'
{{
nginx_user
}}'
}
-
{
path
:
'
{{
nginx_server_static_dir
}}'
,
owner
:
'
{{
common_web_user
}}'
,
group
:
'
{{
nginx_user
}}'
}
-
{
path
:
'
{{
nginx_server_static_dir
}}'
,
owner
:
'
{{
common_web_user
}}'
,
group
:
'
{{
nginx_user
}}'
}
notify
:
restart nginx
notify
:
restart nginx
tags
:
tags
:
-
install
-
install
...
@@ -48,20 +45,6 @@
...
@@ -48,20 +45,6 @@
-
install
-
install
-
install:system-requirements
-
install:system-requirements
# REMOVE THIS AFTER LATEST NGINX HAS BEEN DEPLOYED EVERYWHERE
# New package does not identify conflicts properly.
# "nginx-common" only appears as requirement for ubuntu-distributed package, thus
# removing it will remove all nginx packages installed from Ubuntu's repo.
# This is only required if nginx was previously installed from Ubuntu's repo
# and you're switching to Nginx's PPA
-
name
:
Remove old nginx packages
apt
:
name
:
nginx-common
state
:
absent
tags
:
-
install
-
install:system-requirements
-
name
:
Install the nginx package
-
name
:
Install the nginx package
apt
:
apt
:
name
:
nginx
name
:
nginx
...
@@ -81,72 +64,18 @@
...
@@ -81,72 +64,18 @@
-
install
-
install
-
install:configuration
-
install:configuration
-
name
:
Define server configuration file
and common nginx configuration
-
name
:
Define server configuration file
template
:
template
:
src
:
"
{{
item.src
}}"
src
:
'
etc/nginx/nginx.conf.j2'
dest
:
"
{{
item.dest
}}"
dest
:
'
/etc/nginx/nginx.conf'
owner
:
root
owner
:
root
group
:
"
{{
item.group
}}"
group
:
'
{{
common_web_user
}}'
mode
:
"
{{
item.mode
}}"
mode
:
'
0644'
with_items
:
-
{
src
:
'
etc/nginx/nginx.conf.j2'
,
dest
:
'
/etc/nginx/nginx.conf'
,
group
:
'
{{
common_web_user
}}'
,
mode
:
"
0644"
}
-
{
src
:
'
edx/app/nginx/sites-available/edx-release.j2'
,
dest
:
'
{{
nginx_sites_available_dir
}}/edx-release'
,
group
:
'
root'
,
mode
:
"
0600"
}
notify
:
restart nginx
notify
:
restart nginx
tags
:
tags
:
-
install
-
install
-
install:configuration
-
install:configuration
-
name
:
Create robot rules
template
:
src
:
"
edx/app/nginx/robots.txt.j2"
dest
:
"
{{
nginx_app_dir
}}/robots.txt"
owner
:
root
group
:
"
{{
common_web_user
}}"
mode
:
0644
notify
:
reload nginx
when
:
NGINX_ROBOT_RULES|length > 0
tags
:
-
install
-
install:configuration
-
name
:
Creating link for common nginx configuration
file
:
src
:
"
{{
nginx_sites_available_dir
}}/edx-release"
dest
:
"
{{
nginx_sites_enabled_dir
}}/edx-release"
state
:
link
owner
:
root
group
:
root
notify
:
reload nginx
tags
:
-
install
-
install:configuration
-
name
:
Copying nginx configs for {{ nginx_sites }}
template
:
src
:
"
{{
nginx_template_dir
}}/{{
item
}}.j2"
dest
:
"
{{
nginx_sites_available_dir
}}/{{
item
}}"
owner
:
root
group
:
"
{{
common_web_user
}}"
mode
:
"
0640"
with_items
:
"
{{
nginx_sites
}}"
notify
:
reload nginx
tags
:
-
install
-
install:configuration
-
name
:
Creating nginx config links for {{ nginx_sites }}
file
:
src
:
"
{{
nginx_sites_available_dir
}}/{{
item
}}"
dest
:
"
{{
nginx_sites_enabled_dir
}}/{{
item
}}"
state
:
link
owner
:
root
group
:
root
with_items
:
"
{{
nginx_sites
}}"
notify
:
reload nginx
tags
:
-
install
-
install:configuration
-
name
:
Copying nginx extra configs
-
name
:
Copying nginx extra configs
template
:
template
:
src
:
"
{{
item
}}"
src
:
"
{{
item
}}"
...
@@ -249,52 +178,6 @@
...
@@ -249,52 +178,6 @@
-
install
-
install
-
install:configuration
-
install:configuration
# Check to see if the ssl cert/key exists before copying.
# This extra check is done to prevent failures when
# ansible-playbook is run locally
-
local_action
:
module
:
stat
path
:
"
{{
NGINX_SSL_CERTIFICATE
}}"
become
:
False
register
:
ssl_cert
tags
:
-
install
-
install:configuration
-
local_action
:
module
:
stat
path
:
"
{{
NGINX_SSL_KEY
}}"
become
:
False
register
:
ssl_key
tags
:
-
install
-
install:configuration
-
name
:
copy ssl cert
copy
:
src
:
"
{{
NGINX_SSL_CERTIFICATE
}}"
dest
:
"
/etc/ssl/certs/"
owner
:
root
group
:
root
mode
:
0644
when
:
ssl_cert.stat.exists and NGINX_ENABLE_SSL and NGINX_SSL_CERTIFICATE != 'ssl-cert-snakeoil.pem'
tags
:
-
install
-
install:configuration
-
name
:
copy ssl key
copy
:
src
:
"
{{
NGINX_SSL_KEY
}}"
dest
:
"
/etc/ssl/private/"
owner
:
root
group
:
root
mode
:
0640
when
:
ssl_key.stat.exists and NGINX_ENABLE_SSL and NGINX_SSL_KEY != 'ssl-cert-snakeoil.key'
no_log
:
True
tags
:
-
install
-
install:configuration
# removing default link
# removing default link
-
name
:
Removing default nginx config and restart (enabled)
-
name
:
Removing default nginx config and restart (enabled)
file
:
file
:
...
...
This diff is collapsed.
Click to expand it.
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/edx-release.j2
deleted
100644 → 0
View file @
d89d315f
server {
listen 8099 default_server;
location = /versions.html {
alias {{ nginx_cfg.version_html }};
}
location = /versions.json {
alias {{ nginx_cfg.version_json }};
}
}
This diff is collapsed.
Click to expand it.
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