summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-01-15 11:16:44 +0200
committerSam Thursfield <sam.thursfield@codethink.co.uk>2015-01-15 11:20:29 +0200
commitfffeb572bfac3d013dbd2d16408ae31285eaf1e1 (patch)
tree836ba845b3e80c8711192e40acdb0ca578b7057e
parentb2a44e0fc3b644c5150f0fbc555679d816887acc (diff)
downloadmorph-fffeb572bfac3d013dbd2d16408ae31285eaf1e1.tar.gz
Improvements and fixes to distbuild Ansible admin playbooks
-rw-r--r--distbuild/ansible/restart.yaml10
-rw-r--r--distbuild/ansible/run-from-morph-source-tree.sh.template6
-rw-r--r--distbuild/ansible/use-latest-morph.yaml17
3 files changed, 31 insertions, 2 deletions
diff --git a/distbuild/ansible/restart.yaml b/distbuild/ansible/restart.yaml
index 6cd02be4..3459bbec 100644
--- a/distbuild/ansible/restart.yaml
+++ b/distbuild/ansible/restart.yaml
@@ -1,3 +1,13 @@
+# Restart all Morph instances on a Baserock distbuild network.
+#
+# This will abort any running builds.
+#
+# This is an Ansible playbook. Run with:
+#
+# ansible-playbook -i distbuild-hosts restart.yaml
+#
+# You will need a file named 'distbuild-hosts' describing your distbuild
+# network.
---
- hosts: controller
tasks:
diff --git a/distbuild/ansible/run-from-morph-source-tree.sh.template b/distbuild/ansible/run-from-morph-source-tree.sh.template
new file mode 100644
index 00000000..0fa7ebd0
--- /dev/null
+++ b/distbuild/ansible/run-from-morph-source-tree.sh.template
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Script to use version of a program from a checkout of the morph.git source tree.
+
+source_path=/srv/morph
+PYTHONPATH="$source_path" "$source_path/{{ item }}" "$@"
diff --git a/distbuild/ansible/use-latest-morph.yaml b/distbuild/ansible/use-latest-morph.yaml
index 6e07e8e0..8249dc02 100644
--- a/distbuild/ansible/use-latest-morph.yaml
+++ b/distbuild/ansible/use-latest-morph.yaml
@@ -1,10 +1,23 @@
+# Upgrade the version of Morph used on a Baserock distbuild network.
+#
+# This allows quickly testing a new version of Morph without having to fully
+# build and deploy a new Baserock 'build' system. You should run the
+# 'restart.yaml' playbook after this one.
+#
+# This is an Ansible playbook. Run with:
+#
+# ansible-playbook -i distbuild-hosts use-latest-morph.yaml
+#
+# You will need a file named 'distbuild-hosts' describing your distbuild
+# network.
+
---
- hosts: all
vars:
- TROVE_HOST: git.baserock.org
- MORPH_VERSION: master
tasks:
- - name: check out Morph repository
+ - name: clone Morph repository
command: git clone git://{{ TROVE_HOST }}/baserock/baserock/morph /srv/morph
args:
creates: /srv/morph
@@ -15,7 +28,7 @@
chdir: /srv/morph
- name: ensure latest Morph is used
- file: path=/usr/bin/{{ item }} src=/srv/morph/{{ item }} state=link force=yes
+ template: backup=yes src=run-from-morph-source-tree.sh.template dest=/usr/bin/{{ item }}
with_items:
- morph
- distbuild-helper