Commit b9a5b5d5 by e0d

Code review comments and general cleanup

removing stub code

use ssh_opts

whitespace

whitespace

whitespace

ssh_opts

whitespace

whitespace

Comments

comments.
parent 3bfc9995
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# #
## ##
# Defaults for role xqwatcher # Defaults for role xqwatcher
# #
# #
# vars are namespace with the module name. # vars are namespace with the module name.
...@@ -27,7 +27,8 @@ xqwatcher_code_dir: "{{ xqwatcher_app_dir }}/src" ...@@ -27,7 +27,8 @@ xqwatcher_code_dir: "{{ xqwatcher_app_dir }}/src"
xqwatcher_conf_dir: "{{ xqwatcher_home }}/conf.d" xqwatcher_conf_dir: "{{ xqwatcher_home }}/conf.d"
xqwatcher_data_dir: "{{ xqwatcher_home }}/data" xqwatcher_data_dir: "{{ xqwatcher_home }}/data"
xqwatcher_source_repo: "git@github.com:edx/xqueue-watcher.git" xqwatcher_source_repo: "git@{{ COMMON_GIT_MIRROR }}:edx/xqueue-watcher.git"
xqwatcher_git_ssh_opts: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{ xqwatcher_git_identity }}"
xqwatcher_version: "master" xqwatcher_version: "master"
xqwatcher_git_identity: "{{ xqwatcher_app_dir }}/git-identity" xqwatcher_git_identity: "{{ xqwatcher_app_dir }}/git-identity"
......
...@@ -10,9 +10,7 @@ ...@@ -10,9 +10,7 @@
# #
# #
# Handlers for role xqwatcher # Handlers for role xqwatcher
# #
# Overview: # Overview:
#
# #
- name: notify me #
debug: msg="stub handler"
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
# #
## ##
# Role includes for role xqwatcher # Role includes for role xqwatcher
# #
# the role name are service name differ by _ and -, the latter isn't safe # the role name are service name differ by _ and -, the latter isn't safe
# random corners of ansible/jinga/python variable expansion. # random corners of ansible/jinga/python variable expansion.
dependencies: dependencies:
- role: edx_service - role: edx_service
edx_role_name: "{{ xqwatcher_role_name }}" edx_role_name: "{{ xqwatcher_role_name }}"
edx_service_name: "{{ xqwatcher_service_name }}" edx_service_name: "{{ xqwatcher_service_name }}"
- role: supervisor - role: supervisor
supervisor_app_dir: "{{ xqwatcher_supervisor_app_dir }}" supervisor_app_dir: "{{ xqwatcher_supervisor_app_dir }}"
supervisor_data_dir: "{{ xqwatcher_supervisor_data_dir }}" supervisor_data_dir: "{{ xqwatcher_supervisor_data_dir }}"
......
...@@ -3,15 +3,23 @@ ...@@ -3,15 +3,23 @@
content="{{ XQWATCHER_GIT_IDENTITY }}" dest={{ xqwatcher_git_identity }} content="{{ XQWATCHER_GIT_IDENTITY }}" dest={{ xqwatcher_git_identity }}
owner={{ xqwatcher_user }} group={{ xqwatcher_user }} mode=0600 owner={{ xqwatcher_user }} group={{ xqwatcher_user }} mode=0600
- name: upload ssh script # - name: upload ssh script
template: > # template: >
src=git_ssh.sh.j2 dest=/tmp/git_ssh.sh # src=git_ssh.sh.j2 dest=/tmp/git_ssh.sh
owner={{ xqwatcher_user }} mode=750 # owner={{ xqwatcher_user }} mode=750
- include: deploy_watcher.yml tags=deploy-watcher - name: remove read-only ssh key for the content repo
file: path=/tmp/git_ssh.sh state=absent
- include: deploy_watcher.yml
tags:
- deploy-watcher
- deploy
- include: deploy_courses.yml
tags:
- deploy-courses
- deploy
- include: deploy_courses.yml tags=deploy-courses
- name: remove read-only ssh key for the content repo - name: remove read-only ssh key for the content repo
file: path={{ xqwatcher_git_identity }} state=absent file: path={{ xqwatcher_git_identity }} state=absent
\ No newline at end of file
# Iterates over the data structure documented in tasks/main.yml
# checking out the grader code from the repository specified on
# a per queue basis.
- name: checkout grader code - name: checkout grader code
git: > git: >
dest={{ xqwatcher_data_dir }}/{{ item.COURSE }} repo={{ item.GIT_REPO }} dest={{ xqwatcher_data_dir }}/{{ item.COURSE }} repo={{ item.GIT_REPO }}
version={{ item.GIT_REF }} version={{ item.GIT_REF }}
accept_hostkey=yes ssh_opts="{{ xqwatcher_git_ssh_opts }}"
environment:
GIT_SSH: /tmp/git_ssh.sh
sudo: true sudo: true
sudo_user: "{{ xqwatcher_user }}" sudo_user: "{{ xqwatcher_user }}"
with_items: XQWATCHER_COURSES with_items: XQWATCHER_COURSES
# Installs the xqueue watcher code and supervisor scripts.
# The watcher can watch one or many queues and dispatch submissions
# to the appropriate grader which lives in a separate SCM repository.
- name: checkout watcher code - name: checkout watcher code
git: > git: >
dest={{ xqwatcher_code_dir }} repo={{ xqwatcher_source_repo }} version={{ xqwatcher_version }} dest={{ xqwatcher_code_dir }} repo={{ xqwatcher_source_repo }} version={{ xqwatcher_version }}
accept_hostkey=yes accept_hostkey=yes
environment: ssh_opts="{{ xqwatcher_git_ssh_opts }}"
GIT_SSH: /tmp/git_ssh.sh
sudo: true sudo: true
sudo_user: "{{ xqwatcher_user }}" sudo_user: "{{ xqwatcher_user }}"
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# #
# #
# Tasks for role xqwatcher # Tasks for role xqwatcher
# #
# Overview: # Overview:
# #
# This play installs a sandboxed, pull grader that integrates with XQueue. The # This play installs a sandboxed, pull grader that integrates with XQueue. The
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
# #
- include: code_jail.yml CODE_JAIL_COMPLAIN=false - include: code_jail.yml CODE_JAIL_COMPLAIN=false
- name: create conf dir - name: create conf dir
file: > file: >
path="{{ xqwatcher_conf_dir }}" path="{{ xqwatcher_conf_dir }}"
...@@ -96,7 +96,6 @@ ...@@ -96,7 +96,6 @@
owner="{{ xqwatcher_user }}" owner="{{ xqwatcher_user }}"
group="{{ xqwatcher_user }}" group="{{ xqwatcher_user }}"
- name: create supervisor dirs - name: create supervisor dirs
file: > file: >
path="{{ xqwatcher_conf_dir }}" path="{{ xqwatcher_conf_dir }}"
...@@ -105,13 +104,13 @@ ...@@ -105,13 +104,13 @@
group="{{ xqwatcher_user }}" group="{{ xqwatcher_user }}"
with_items: with_items:
- "{{ xqwatcher_supervisor_data_dir }}" - "{{ xqwatcher_supervisor_data_dir }}"
- "{{ xqwatcher_supervisor_log_dir }}" - "{{ xqwatcher_supervisor_log_dir }}"
- name: write out course config files - name: write out course config files
template: > template: >
src=edx/app/xqwatcher/conf.d/course.json.j2 src=edx/app/xqwatcher/conf.d/course.json.j2
dest={{ xqwatcher_conf_dir }}/{{ item.COURSE }}.json dest={{ xqwatcher_conf_dir }}/{{ item.COURSE }}.json
mode=0644 owner={{ xqwatcher_user }} group={{ xqwatcher_user }} mode=0644 owner={{ xqwatcher_user }} group={{ xqwatcher_user }}
with_items: XQWATCHER_COURSES with_items: XQWATCHER_COURSES
- include: deploy.yml tags=deploy - include: deploy.yml tags=deploy
#!/bin/sh
exec /usr/bin/ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{ xqwatcher_git_identity }} "$@"
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