Commit ea9806d4 by Feanil Patel

Merge pull request #150 from edx/feanil/ansible_grader_testing

Get end to end grader testing working.
parents cc176620 fd7322c3
......@@ -2,7 +2,7 @@
- hosts: tag_aws_cloudformation_stack-name_feanilpractice:&tag_group_edxapp
sudo: True
vars_files:
- "{{ secure_dir }}/vars/edxapp_continuous_integration_vars.yml"
- "{{ secure_dir }}/vars/edx_continuous_integration_vars.yml"
- "{{ secure_dir }}/vars/users.yml"
roles:
- common
......@@ -12,19 +12,27 @@
- hosts: tag_aws_cloudformation_stack-name_feanilpractice:&tag_group_xserver
sudo: True
vars_files:
- "{{ secure_dir }}/vars/edxapp_continuous_integration_vars.yml"
- "{{ secure_dir }}/vars/edx_continuous_integration_vars.yml"
- "{{ secure_dir }}/vars/users.yml"
roles:
- common
- nginx
- xserver
- hosts: tag_aws_cloudformation_stack-name_feanilpractice:&tag_group_rabbitmq
serial: 1
sudo: True
vars_files:
- "{{ secure_dir }}/vars/edxapp_continuous_integration_vars.yml"
- "{{ secure_dir }}/vars/edx_continuous_integration_vars.yml"
- "{{ secure_dir }}/vars/users.yml"
roles:
- common
- rabbitmq
- hosts: tag_aws_cloudformation_stack-name_feanilpractice:&tag_group_xqueue
sudo: True
vars_files:
- "{{ secure_dir }}/vars/edx_continuous_integration_vars.yml"
- "{{ secure_dir }}/vars/users.yml"
roles:
- common
- nginx
- xqueue
......@@ -62,3 +62,8 @@
- 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.
- name: make sure nginx has started
service: name=nginx state=started
......@@ -20,6 +20,16 @@ server {
proxy_pass http://lms-xml-backend;
}
location @proxy_to_lms-xml_app {
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://lms-xml-backend;
}
location / {
try_files $uri @proxy_to_lms-xml_app;
}
......
......@@ -56,6 +56,13 @@
rabbitmq_user: user="guest" state=absent
- name: add admin users
rabbitmq_user: user='{{item.name}}' password='{{item.password}}' tags="administrator" state=present
rabbitmq_user: >
user='{{item.name}}'
password='{{item.password}}'
read_priv='.*'
write_priv='.*'
configure_priv='.*'
tags="administrator"
state=present
with_items: rabbitmq_auth_config.admins
when: "'admins' in rabbitmq_auth_config"
......@@ -15,3 +15,6 @@
tags:
- xqueue
- deploy
- name: restart xqueue consumer
service: name=xqueue_consumer state=restarted
......@@ -5,6 +5,12 @@
- xqueue
- deploy
- name: stop xqueue consumer service
service: name=xqueue_consumer state=stopped
tags:
- xqueue
- deploy
# Do A Checkout
- name: git checkout xqueue repo into $app_base_dir
git: dest={{xqueue_code_dir}} repo={{xqueue_source_repo}} version={{xqueue_version}}
......@@ -53,6 +59,14 @@
- syncdb
- deploy
- name: create users
shell: sudo -u www-data /opt/edx/bin/django-admin.py update_users --settings=xqueue.aws_settings --pythonpath=/opt/wwc/xqueue
when: update_users is defined
tags:
- xqueue
- syncdb
- deploy
- name: stop xqueue
service: name=xqueue state=stopped
tags:
......@@ -64,3 +78,9 @@
tags:
- xqueue
- deploy
- name: start xqueue consumer
service: name=xqueue_consumer state=started
tags:
- xqueue
- deploy
......@@ -8,30 +8,56 @@
tags:
- xqueue
- name: create xqueue db
mysql_db: >
name={{xqueue_auth_config.DATABASES.default.NAME}}
login_host={{xqueue_auth_config.DATABASES.default.HOST}}
login_user={{xqueue_auth_config.DATABASES.default.USER}}
login_password={{xqueue_auth_config.DATABASES.default.PASSWORD}}
state=present
encoding=utf8
# Check out xqueue repo to $app_base_dir
- name: install git and its recommends
apt: pkg=git state=present install_recommends=yes
tags:
- xqueue
- name: install a bunch of system packages on which LMS and CMS rely
apt: pkg={{item}} state=present
with_items: xqueue_debian_pkgs
- name: install a bunch of system packages on which xqueue relies
apt: pkg={{','.join(xqueue_debian_pkgs)}} state=present
notify:
- restart xqueue
- restart xqueue consumer
tags:
- xqueue
- name: create xqueue application config
template: src=xqueue.env.json.j2 dest=$app_base_dir/env.json mode=0640 owner=www-data group=adm
notify:
- restart xqueue
- restart xqueue consumer
tags:
- xqueue
- name: create xqueue auth file
template: src=xqueue.auth.json.j2 dest=$app_base_dir/auth.json mode=0640 owner=www-data group=adm
notify:
- restart xqueue
- restart xqueue consumer
tags:
- xqueue
- name: creating xqueue upstart script
template: src=xqueue.conf.j2 dest=/etc/init/xqueue.conf mode=0640 owner=root group=adm
notify:
- restart xqueue
tags:
- xqueue
- name: create xqueue consumer upstart script
template: src=xqueue_consumer.conf.j2 dest=/etc/init/xqueue_consumer.conf mode=0640 owner=root group=adm
notify:
- restart xqueue consumer
tags:
- xqueue
......
# gunicorn
description "xqueue server"
author "devops <devops@edx.org>"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 3 30
env LANG=en_US.UTF-8
env WORKERS_PER_QUEUE={{xqueue_env_config.XQUEUE_WORKERS_PER_QUEUE}}
chdir {{xqueue_code_dir}}
setuid www-data
exec {{venv_dir}}/bin/django-admin.py run_consumer --pythonpath={{xqueue_code_dir}} --settings=xqueue.aws_settings $WORKERS_PER_QUEUE
......@@ -116,3 +116,5 @@ xqueue_debian_pkgs:
- yui-compressor
- zip
- zlib1g-dev
# Needed to be able to create the xqueue mysqldb.
- python-mysqldb
......@@ -12,6 +12,9 @@
- name: create sandbox python directory
file: path={{ xserver_sandbox_venv_dir }} owner=ubuntu group=adm mode=2775 state=directory
- name: create sandbox sudoers file
template: src=99-sandbox.j2 dest=/etc/sudoers.d/99-sandbox owner=root group=root mode=0440
- name: create sandbox python
command: /usr/local/bin/virtualenv {{ xserver_sandbox_venv_dir }} --distribute creates={{ xserver_sandbox_venv_dir }}/bin/activate
......
www-data ALL=(sandbox) NOPASSWD:{{xserver_sandbox_venv_dir}}/bin/python
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