From fffeb572bfac3d013dbd2d16408ae31285eaf1e1 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Thu, 15 Jan 2015 11:16:44 +0200 Subject: Improvements and fixes to distbuild Ansible admin playbooks --- distbuild/ansible/restart.yaml | 10 ++++++++++ .../ansible/run-from-morph-source-tree.sh.template | 6 ++++++ distbuild/ansible/use-latest-morph.yaml | 17 +++++++++++++++-- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 distbuild/ansible/run-from-morph-source-tree.sh.template 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 -- cgit v1.2.1