Commit eb0f151d by John Jarvis

Adding nginx role

* New role for nginx, main.yml will install the nginx package
* By default create the basic version nginx config
* Add variables for nginx package version and template in group_vars/all
* Refresh apt-cache in common role
parent 6e85c9b9
......@@ -6,4 +6,5 @@
- "vars/secure/edxapp_stage_users.yml"
roles:
- common
- nginx
- lms
---
nginx_cfg:
version_html: /opt/wwc/versions.html
version_json: /opt/wwc/versions.json
pkgs:
nginx:
state: installed
......@@ -2,7 +2,10 @@
- include: create_users.yml
- name: Create application root
sudo: True
action: file path=/opt/wwc state=directory owner=root group=root
file: path=/opt/wwc state=directory owner=root group=root
- name: Create log directory
sudo: True
action: file path=/mnt/logs state=directory
file: path=/mnt/logs state=directory
- name: Update apt cache
sudo: True
apt: update_cache=yes
---
- name: create lms application config
action: template src=env.json.j2 dest=/opt/wwc/lms-env.json
template: src=env.json.j2 dest=/opt/wwc/lms-env.json
sudo: True
- name: create lms auth file
action: template src=auth.json.j2 dest=/opt/wwc/lms-auth.json
template: src=auth.json.j2 dest=/opt/wwc/lms-auth.json
sudo: True
* main.yml: installs nginx and will enable the basic nginx configuration for version introspection
---
- name: Install nginx
sudo: True
apt: pkg=nginx state={{ pkgs.nginx.state }}
- include: nginx_site.yml state=link site_name=edx-release
# Requires nginx package
---
- name: Copying nginx config
sudo: True
template: src={{ site_name }}.j2 dest=/etc/nginx/sites-available/{{ site_name }}
- name: Creating nginx config link
sudo: True
file: src=/etc/nginx/sites-available/{{ site_name }} dest=/etc/nginx/sites-enabled/{{ site_name }} state={{ state }} owner=root group=root
server {
listen 8099 default_server;
server_name mitx_release.*;
location = /versions.html {
alias {{ nginx_cfg.version_html }};
}
location = /versions.json {
alias {{ nginx_cfg.version_json }};
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment