Commit a5b33c91 by John Jarvis

Merge pull request #129 from edx/jarv/update-edxapp-deploy

Jarv/update edxapp deploy
parents 5405e56d e63b766a
- name: Configure instance(s)
hosts: jenkins_test
sudo: True
gather_facts: True
vars:
migrate_db: True
mysql5_workaround: True
ansible_ssh_private_key_file: /var/lib/jenkins/continuous-integration.pem
vars_files:
- "{{ secure_dir }}/vars/edxapp_ref_users.yml"
- "{{ secure_dir }}/vars/edxapp_sandbox.yml"
roles:
- common
- nginx
- edxlocal
- edxapp
- xqueue
- xserver
......@@ -8,6 +8,7 @@
security_group: sandbox
image: ami-d0f89fb9
region: us-east-1
instance_tags: '{"disposable": "true"}'
roles:
- launch_instance
......@@ -17,6 +18,7 @@
gather_facts: True
vars:
migrate_db: True
mysql5_workaround: True
ansible_ssh_private_key_file: /var/lib/jenkins/continuous-integration.pem
vars_files:
- "{{ secure_dir }}/vars/edxapp_ref_users.yml"
......
[jenkins_test]
jenkins-test.sandbox.edx.org
Defaults env_keep+=SSH_AUTH_SOCK
......@@ -78,25 +78,8 @@
- logging
- update
# Install ssh keys for ubuntu account to be able to check out from edx-platform
# Temprory behavior, not needed after June 1. Perhaps still useful as a recipe.
# {{ secure_dir }} is relative to the top-level playbooks dir so there is some
- name: install read-only ssh key for edx-platform repo (private)
copy: src={{ secure_dir }}/files/git-identity dest=/etc/git-identity force=yes owner=ubuntu group=adm mode=600
tags:
- lms
- cms
- update
- name: upload ssh script
copy: src=git_ssh.sh dest=/tmp/git_ssh.sh force=yes owner=root group=adm mode=750
tags:
- lms
- cms
- update
- name: upload sudo config for key forwarding as root
copy: src=ssh_key_forward dest=/etc/sudoers.d/ssh_key_forward validate='visudo -c -f %s'
- include: create_venv.yml
- include: edx_logging_base.yml
- include: software_update.yml
#!/bin/bash
# Placed by ansible; some hardcoded values originate from variables substituted
# by jinja
function usage() {
echo "update.sh [cms|lms|all|none]"
echo " option is what services to collectstatic and restart (default=all)"
}
if [ $# -gt 1 ]; then
usage
exit 1
fi
if [ $# == 0 ]; then
do_CMS=1
do_LMS=1
else
case $1 in
cms)
do_CMS=1
;;
lms)
do_LMS=1
;;
both|all)
do_CMS=1
do_LMS=1
;;
none)
;;
*)
usage
exit 1
;;
esac
fi
function run() {
echo
echo "======== $@"
$@
}
source /etc/profile
source {{venv_dir}}/bin/activate
export PATH=$PATH:/opt/www/.gem/bin
cd {{edx_platform_code_dir}}
BRANCH="origin/feature/edx-west/stanford-theme"
run git fetch origin -p
run git checkout $BRANCH
if [[ $do_CMS ]]; then
export SERVICE_VARIANT=cms
run rake cms:gather_assets:aws
run sudo restart cms
fi
if [[ $do_LMS ]]; then
export SERVICE_VARIANT=lms
run rake lms:gather_assets:aws
run sudo restart lms
fi
---
- name: invoke all deploy handlers
shell: echo "running deploy handlers"
notify:
- gem | gem install bundler
- bundle | bundle install
- Install edx-platform npm dependencies
- install python pre-requirements
- install python base-requirements
- install python post-requirements
- install python post-post requirements
- check if rake gather_assets is available
- check if django can collect lms static data
- check if django can collect cms static data
- check if django can update cms templates
- gather lms static assets with rake
- gather lms static assets with django
- gather cms static assets with rake
- gather cms static assets with django
- update cms templates
- lms asset static failure check
- cms asset static failure check
- syncdb and migrate
- stop edxapp
- start edxapp
tags:
- lms
- cms
- install
- deploy
# Ruby plays that need to be run after platform updates.
- name: gem | gem install bundler
shell: RBENV_ROOT={{ rbenv_root }} GEM_HOME={{ gem_home }} {{ rbenv_root }}/shims/gem install bundle chdir={{ edx_platform_code_dir }}
tags:
- ruby
- deploy
- install
- name: bundle | bundle install
shell: RBENV_ROOT={{ rbenv_root }} GEM_HOME={{ gem_home }} {{ gem_home }}/bin/bundle install --binstubs chdir={{ edx_platform_code_dir }}
tags:
- ruby
- deploy
- install
# Node play that need to be run after platform updates.
- name: Install edx-platform npm dependencies
shell: npm install chdir={{ edx_platform_code_dir }}
tags:
- npm
- update
- deploy
# Python plays that need to be run after platform updates.
# Install the python pre requirements into {{ venv_dir }}
- name : install python pre-requirements
pip: requirements="{{pre_requirements_file}}" virtualenv="{{venv_dir}}" state=present
tags:
- lms
- cms
- install
- deploy
# Install the python modules into {{ venv_dir }}
- name : install python base-requirements
# Need to use shell rather than pip so that we can maintain the context of our current working directory; some
# requirements are pathed relative to the edx-platform repo. Using the pip from inside the virtual environment implicitly
# installs everything into that virtual environment.
shell: cd {{ edx_platform_code_dir }} && {{ venv_dir }}/bin/pip install --use-mirrors -r {{ base_requirements_file }}
tags:
- lms
- cms
- install
- deploy
# Install the python post requirements into {{ venv_dir }}
- name : install python post-requirements
pip: requirements="{{post_requirements_file}}" virtualenv="{{venv_dir}}" state=present
tags:
- lms
- cms
- install
- deploy
# Install the final python modules into {{ venv_dir }}
- name : install python post-post requirements
# Need to use shell rather than pip so that we can maintain the context of our current working directory; some
# requirements are pathed relative to the edx-platform repo. Using the pip from inside the virtual environment implicitly
# installs everything into that virtual environment.
shell: cd {{ edx_platform_code_dir }} && {{ venv_dir }}/bin/pip install --use-mirrors -r {{ item }}
with_items:
- "{{ repo_requirements_file }}"
- "{{ github_requirements_file }}"
- "{{ local_requirements_file }}"
tags:
- lms
- cms
- install
- deploy
# This check needs to be run to see if rake can be used but its failure should not stop the run.
- name: check if rake gather_assets is available
shell: executable=/bin/bash chdir={{ edx_platform_code_dir }} rake -T | grep gather_assets
environment: "{{ deploy_environment }}"
register: grep_gather_assets
ignore_errors: yes
tags:
- lms
- lms-preview
- lms-xml
- cms
- deploy
- name: check if django can collect lms static data
shell: SERVICE_VARIANT={{ lms_variant }} django-admin.py help collectstatic --pythonpath={{ edx_platform_code_dir }} --settings=lms.envs.aws
register: check_lms_collect_static
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- lms
- lms-preview
- lms-xml
- deploy
- name: check if django can collect cms static data
shell: SERVICE_VARIANT={{ lms_variant }} django-admin.py help collectstatic --pythonpath={{ edx_platform_code_dir }} --settings=cms.envs.aws
register: check_cms_collect_static
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- cms
- deploy
- name: check if django can update cms templates
shell: SERVICE_VARIANT={{ cms_variant }} django-admin.py help update_templates --pythonpath={{ edx_platform_code_dir }} --settings=cms.envs.aws
register: check_cms_update_templates
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- cms
- deploy
# Gather lms assets using rake if possible
- name: gather lms static assets with rake
shell: executable=/bin/bash chdir={{ edx_platform_code_dir }} SERVICE_VARIANT={{ lms_variant }} rake lms:gather_assets:aws
when: grep_gather_assets.rc == 0
notify:
- stop edxapp
- start edxapp
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- lms
- lms-preview
- lms-xml
- deploy
# Gather lms assets using django if necessary(When rake doesn't know how)
- name: gather lms static assets with django
shell: SERVICE_VARIANT={{ lms_variant }} django-admin.py collectstatic --pythonpath={{ edx_platform_code_dir }} --settings=lms.envs.aws --noinput --verbosity=0
when: grep_gather_assets.rc != 0 and check_lms_collect_static.rc == 0
notify:
- stop edxapp
- start edxapp
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
- name: start edxapp
service: name=edxapp state=started
tags:
- lms
- lms-preview
- lms-xml
- deploy
# Gather cms assets using rake if possible
- name: gather cms static assets with rake
# script: gather_assets.sh
shell: executable=/bin/bash chdir={{ edx_platform_code_dir }} SERVICE_VARIANT={{ cms_variant }} rake cms:gather_assets:aws
when: grep_gather_assets.rc == 0
notify:
- stop edxapp
- start edxapp
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- cms
- deploy
- name: gather cms static assets with django
shell: SERVICE_VARIANT={{ cms_variant }} django-admin.py collectstatic --pythonpath={{ edx_platform_code_dir }} --settings=lms.envs.aws --noinput --verbosity=0
when: grep_gather_assets.rc != 0 and check_cms_collect_static.rc == 0
notify:
- stop edxapp
- start edxapp
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- cms
- deploy
- name: update cms templates
shell: SERVICE_VARIANT={{ cms_variant }} django-admin.py update_templates --pythonpath={{ edx_platform_code_dir }} --settings=cms.envs.aws
when: check_cms_update_templates.rc == 0
notify:
- stop edxapp
- start edxapp
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- cms
- deploy
# Add failure checks for if no static assets were deployed.
- name: lms asset static failure check
shell: /bin/false
when: grep_gather_assets.rc != 0 and check_lms_collect_static.rc != 0
tags:
- lms
- lms-preview
- lms-xml
- deploy
- name: cms asset static failure check
shell: /bin/false
when: grep_gather_assets.rc != 0 and check_cms_collect_static.rc != 0
tags:
- cms
- deploy
- name: syncdb and migrate
shell: sudo -u www-data SERVICE_VARIANT=lms /opt/edx/bin/django-admin.py syncdb --migrate --noinput --settings=lms.envs.aws --pythonpath=/opt/wwc/edx-platform
when: migrate_db is defined
tags:
- deploy
- lms
- lms-xml
- lms-preview
- cms
- syncdb
- name: stop edxapp
service: name=edxapp state=stopped
tags:
......@@ -257,12 +17,11 @@
- cms
- deploy
- name: start edxapp
service: name=edxapp state=started
- name: restart edxapp
service: name=edxapp state=restarted
tags:
- lms
- lms-xml
- lms-preview
- cms
- deploy
......@@ -50,13 +50,245 @@
- install
- deploy
# want deploy handlers to always run when deploy tag is specified, so move into a no op task
- name: run deploy handlers
shell: echo "running deploy handlers"
notify:
- invoke all deploy handlers
# Ruby plays that need to be run after platform updates.
- name: gem | gem install bundler
shell: RBENV_ROOT={{ rbenv_root }} GEM_HOME={{ gem_home }} {{ rbenv_root }}/shims/gem install bundle chdir={{ edx_platform_code_dir }}
tags:
- ruby
- deploy
- install
- name: bundle | bundle install
shell: RBENV_ROOT={{ rbenv_root }} GEM_HOME={{ gem_home }} {{ gem_home }}/bin/bundle install --binstubs chdir={{ edx_platform_code_dir }}
tags:
- ruby
- deploy
- install
# Node play that need to be run after platform updates.
- name: Install edx-platform npm dependencies
shell: npm install chdir={{ edx_platform_code_dir }}
tags:
- npm
- update
- deploy
# Python plays that need to be run after platform updates.
# Install the python pre requirements into {{ venv_dir }}
- name : install python pre-requirements
pip: requirements="{{pre_requirements_file}}" virtualenv="{{venv_dir}}" state=present
tags:
- lms
- cms
- install
- deploy
# Install the python modules into {{ venv_dir }}
- name : install python base-requirements
# Need to use shell rather than pip so that we can maintain the context of our current working directory; some
# requirements are pathed relative to the edx-platform repo. Using the pip from inside the virtual environment implicitly
# installs everything into that virtual environment.
shell: cd {{ edx_platform_code_dir }} && {{ venv_dir }}/bin/pip install --use-mirrors -r {{ base_requirements_file }}
tags:
- lms
- cms
- install
- deploy
# Install the python post requirements into {{ venv_dir }}
- name : install python post-requirements
pip: requirements="{{post_requirements_file}}" virtualenv="{{venv_dir}}" state=present
tags:
- lms
- cms
- install
- deploy
# Install the final python modules into {{ venv_dir }}
- name : install python post-post requirements
# Need to use shell rather than pip so that we can maintain the context of our current working directory; some
# requirements are pathed relative to the edx-platform repo. Using the pip from inside the virtual environment implicitly
# installs everything into that virtual environment.
shell: cd {{ edx_platform_code_dir }} && {{ venv_dir }}/bin/pip install --use-mirrors -r {{ item }}
with_items:
- "{{ repo_requirements_file }}"
- "{{ github_requirements_file }}"
- "{{ local_requirements_file }}"
tags:
- lms
- cms
- install
- deploy
# This check needs to be run to see if rake can be used but its failure should not stop the run.
- name: check if rake gather_assets is available
shell: executable=/bin/bash chdir={{ edx_platform_code_dir }} rake -T | grep gather_assets
environment: "{{ deploy_environment }}"
register: grep_gather_assets
ignore_errors: yes
tags:
- lms
- lms-preview
- lms-xml
- cms
- deploy
- name: check if django can collect lms static data
shell: SERVICE_VARIANT={{ lms_variant }} django-admin.py help collectstatic --pythonpath={{ edx_platform_code_dir }} --settings=lms.envs.aws
register: check_lms_collect_static
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- lms
- lms-preview
- lms-xml
- deploy
- name: check if django can collect cms static data
shell: SERVICE_VARIANT={{ lms_variant }} django-admin.py help collectstatic --pythonpath={{ edx_platform_code_dir }} --settings=cms.envs.aws
register: check_cms_collect_static
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- cms
- deploy
- name: check if django can update cms templates
shell: SERVICE_VARIANT={{ cms_variant }} django-admin.py help update_templates --pythonpath={{ edx_platform_code_dir }} --settings=cms.envs.aws
register: check_cms_update_templates
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- cms
- deploy
# Gather lms assets using rake if possible
- name: gather lms static assets with rake
shell: executable=/bin/bash chdir={{ edx_platform_code_dir }} SERVICE_VARIANT={{ lms_variant }} rake lms:gather_assets:aws
when: grep_gather_assets.rc == 0
notify:
- stop edxapp
- start edxapp
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- lms
- lms-preview
- lms-xml
- deploy
# Gather lms assets using django if necessary(When rake doesn't know how)
- name: gather lms static assets with django
shell: SERVICE_VARIANT={{ lms_variant }} django-admin.py collectstatic --pythonpath={{ edx_platform_code_dir }} --settings=lms.envs.aws --noinput --verbosity=0
when: grep_gather_assets.rc != 0 and check_lms_collect_static.rc == 0
notify:
- stop edxapp
- start edxapp
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- lms
- lms-preview
- lms-xml
- deploy
# Gather cms assets using rake if possible
- name: gather cms static assets with rake
# script: gather_assets.sh
shell: executable=/bin/bash chdir={{ edx_platform_code_dir }} SERVICE_VARIANT={{ cms_variant }} rake cms:gather_assets:aws
when: grep_gather_assets.rc == 0
notify:
- stop edxapp
- start edxapp
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- cms
- deploy
- name: gather cms static assets with django
shell: SERVICE_VARIANT={{ cms_variant }} django-admin.py collectstatic --pythonpath={{ edx_platform_code_dir }} --settings=lms.envs.aws --noinput --verbosity=0
when: grep_gather_assets.rc != 0 and check_cms_collect_static.rc == 0
notify:
- stop edxapp
- start edxapp
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- cms
- deploy
- name: update cms templates
shell: SERVICE_VARIANT={{ cms_variant }} django-admin.py update_templates --pythonpath={{ edx_platform_code_dir }} --settings=cms.envs.aws
when: check_cms_update_templates.rc == 0
notify:
- stop edxapp
- start edxapp
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- cms
- deploy
# Add failure checks for if no static assets were deployed.
- name: lms asset static failure check
shell: /bin/false
when: grep_gather_assets.rc != 0 and check_lms_collect_static.rc != 0
tags:
- lms
- lms-preview
- lms-xml
- deploy
- name: cms asset static failure check
shell: /bin/false
when: grep_gather_assets.rc != 0 and check_cms_collect_static.rc != 0
tags:
- cms
- deploy
# https://code.launchpad.net/~wligtenberg/django-openid-auth/mysql_fix/+merge/22726
# This is necessary for the local mysql5.5, not sure if this fix will ever get merged
# We should never do this in production
- name: mysql5.5 workaround - NOT FOR PRODUCTION
shell: sed -i -e 's/claimed_id = models.TextField(max_length=2047, unique=True/claimed_id = models.TextField(max_length=2047/' /opt/edx/lib/python2.7/site-packages/django_openid_auth/models.py
when: mysql5_workaround is defined
- name: syncdb and migrate
shell: sudo -u www-data SERVICE_VARIANT=lms /opt/edx/bin/django-admin.py syncdb --migrate --noinput --settings=lms.envs.aws --pythonpath=/opt/wwc/edx-platform
when: migrate_db is defined
tags:
- deploy
- lms
- lms-xml
- lms-preview
- cms
- syncdb
- name: stop edxapp
service: name=edxapp state=stopped
tags:
- lms
- lms-xml
- lms-preview
- cms
- deploy
- name: start edxapp
service: name=edxapp state=started
tags:
- lms
- lms-xml
- lms-preview
- cms
- deploy
......@@ -3,6 +3,13 @@
# - 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.
#
# We could install from source instead:
# http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.62.tar.gz
#
---
- name: install python-pymongo (req for ansible)
pip: name=pymongo
......
......@@ -2,12 +2,20 @@
# adds it to the host group
- name: Launch instance
local_action: ec2 keypair=$keypair group=$security_group instance_type=$instance_type image=$image wait=true region=$region
local_action:
module: ec2
keypair: "{{keypair}}"
group: "{{security_group}}"
instance_type: "{{instance_type}}"
image: "{{image}}"
wait: true
region: "{{region}}"
instance_tags: "{{instance_tags}}"
register: ec2
- name: Add new instance to host group
local_action: add_host hostname=${item.public_ip} groupname=launched
with_items: ${ec2.instances}
with_items: ${ec2.instances}
- name: Wait for SSH to come up
local_action: wait_for host=${item.public_dns_name} port=22 delay=60 timeout=320 state=started
......
---
instance_tags: '{"from_ansible": "true"}'
upstream app_server {
upstream xqueue_app_server {
# For a TCP configuration:
server 127.0.0.1:{{ xqueue_gunicorn_port }} fail_timeout=0;
}
......@@ -18,7 +18,7 @@ location @proxy_to_app {
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app_server;
proxy_pass http://xqueue_app_server;
}
}
---
- name: invoke all deploy handlers
shell: echo "running deploy handlers"
notify:
- install python pre-requirements
- install python post-requirements
- syncdb and migrate
- stop xqueue
- start xqueue
tags:
- xqueue
- deploy
# Install the python pre requirements into {{ venv_dir }}
- name : install python pre-requirements
pip: requirements="{{xqueue_pre_requirements_file}}" virtualenv="{{venv_dir}}" state=present
tags:
- xqueue
- deploy
# Install the python post requirements into {{ venv_dir }}
- name : install python post-requirements
pip: requirements="{{xqueue_post_requirements_file}}" virtualenv="{{venv_dir}}" state=present
tags:
- xqueue
- deploy
- name: syncdb and migrate
shell: sudo -u www-data /opt/edx/bin/django-admin.py syncdb --migrate --noinput --settings=xqueue_aws_settings --pythonpath=/opt/wwc/xqueue
when: migrate_db is defined
tags:
- xqueue
- syncdb
- deploy
- name: stop xqueue
service: name=xqueue state=stopped
tags:
......@@ -47,3 +10,8 @@
- xqueue
- deploy
- name: restart xqueue
service: name=xqueue state=restarted
tags:
- xqueue
- deploy
......@@ -31,11 +31,36 @@
- xqueue
- deploy
# want deploy handlers to always run when deploy tag is specified, so move into a no op task
- name: run deploy handlers
shell: echo "running deploy handlers"
notify:
- invoke all deploy handlers
# Install the python pre requirements into {{ venv_dir }}
- name : install python pre-requirements
pip: requirements="{{xqueue_pre_requirements_file}}" virtualenv="{{venv_dir}}" state=present
tags:
- xqueue
- deploy
# Install the python post requirements into {{ venv_dir }}
- name : install python post-requirements
pip: requirements="{{xqueue_post_requirements_file}}" virtualenv="{{venv_dir}}" state=present
tags:
- xqueue
- deploy
- name: syncdb and migrate
shell: sudo -u www-data /opt/edx/bin/django-admin.py syncdb --migrate --noinput --settings=xqueue.aws_settings --pythonpath=/opt/wwc/xqueue
when: migrate_db is defined
tags:
- xqueue
- syncdb
- deploy
- name: stop xqueue
service: name=xqueue state=stopped
tags:
- xqueue
- deploy
- name: start xqueue
service: name=xqueue state=started
tags:
- xqueue
- deploy
......@@ -4,32 +4,42 @@
- deploy
- name: checkout code
git: dest={{ xserver_code_dir }} repo={{ xserver_source_repo }} version={{ xserver_version }}
git: dest={{xserver_code_dir}} repo={{xserver_source_repo}} version={{xserver_version}}
tags:
- deploy
- name: install requirements
pip: requirements="{{ xserver_requirements_file }}" virtualenv="{{ venv_dir }}" state=present
pip: requirements="{{xserver_requirements_file}}" virtualenv="{{venv_dir}}" state=present
tags:
- deploy
- name: install sandbox requirements
pip: requirements="{{ xserver_requirements_file }}" virtualenv="{{ xserver_sandbox_venv_dir }}" state=present
pip: requirements="{{xserver_requirements_file}}" virtualenv="{{xserver_sandbox_venv_dir}}" state=present
tags:
- deploy
- name: create xserver application config
template: src=xserver.env.json.j2 dest={{ app_base_dir }}/env.json mode=640 owner=www-data group=adm
template: src=xserver.env.json.j2 dest={{app_base_dir}}/env.json mode=640 owner=www-data group=adm
tags:
- deploy
- name: install read-only ssh key for the content repo that is required for grading
copy: src={{ xserver_git_identity_path }} dest=/etc/git-identity force=yes owner=ubuntu group=adm mode=60
tags:
- deploy
- name: checkout grader code
git: dest={{ xserver_grader_dir }} repo={{ xserver_grader_source }} version={{ xserver_grader_version }}
git: dest={{xserver_grader_dir}} repo={{xserver_grader_source}} version={{xserver_grader_version}}
environment:
GIT_SSH: /tmp/git_ssh.sh
tags:
- deploy
- name: remove read-only ssh key for the content repo
file: path=/etc/git-identity state=absent
tags:
- deploy
- name: start xserver
service: name=xserver state=started
tags:
......
# Provision and bring up xserver
# As of right now this role requires
# access to the edX 6.00x repo which is not public
---
- name: ensure sandbox group exists
......@@ -45,6 +47,9 @@
apt: pkg={{ item }} state=present
with_items: xserver_debian_pkgs
- name: 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
......@@ -8,7 +8,7 @@
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
upstream app_server {
upstream xserver_app_server {
# For a TCP configuration:
server 127.0.0.1:{{ xserver_port }} fail_timeout=0;
}
......@@ -28,6 +28,6 @@ location @proxy_to_app {
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app_server;
proxy_pass http://xserver_app_server;
}
}
......@@ -2,7 +2,7 @@
---
xserver_env_config: {}
xserver_git_identity_path: "{{ secure_dir }}/files/git-identity"
xserver_code_dir: "{{ app_base_dir }}/xserver"
xserver_source_repo: "git://github.com/edx/xserver.git"
# This should probably be overridden in the playbook or groupvars
......
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