summaryrefslogtreecommitdiff
path: root/distbuild/ansible/use-latest-morph.yaml
blob: 24a8157c02ba32e985195512e0a87bb582547924 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# 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: clone Morph repository
      command: git clone git://{{ TROVE_HOST }}/baserock/baserock/morph /srv/morph
      args:
        creates: /srv/morph

    - name: update Morph repository
      command: git remote update origin
      args:
        chdir: /srv/morph

    - name: check out specified version of Morph
      command: git checkout {{ MORPH_VERSION }}
      args:
        chdir: /srv/morph

    - name: ensure latest Morph is used
      template: backup=yes src=run-from-morph-source-tree.sh.template dest=/usr/bin/{{ item }} mode=0755
      with_items:
        - morph
        - distbuild-helper