blob: ee82343bc49e7ffcac0b4e087f14d21b06e9c6ab (
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
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# Ansible playbook to setup buildbot instance.
# Edit buildbot.hosts to set builder and pass variables.
# Then exec:
#
# ansible-playbook -i buildbot.hosts buildbot.yml
#
# botuser can be overridden from command line:
#
# ansible-playbook -i hosts buildbot.yml -e 'botuser=sconsy'
#
# Tested with Ansible 1.5.0, based on
# http://scons.org/wiki/InstallingBuildbotSlaves
# Send questions to:
#
# anatoly techtonik <techtonik@gmail.com>
#
---
# host is overridable with --extra-vars 'host=address'
- hosts: "{{ host | default('localhost') }}"
vars:
# botuser can be overridden with -e 'botuser=scons2'
- botuser: scons
- hgrc: /home/{{ botuser }}/.hgrc
- venv: /home/{{ botuser }}/buildbot-virtualenv
- work: /home/{{ botuser }}/buildbot-workdir
tasks:
# --- install requirements ---
- name: ubuntu/debian - make sure mercurial is installed
apt: pkg={{ item }}
with_items:
- mercurial
- python-virtualenv
# --- enable mercurial purge extension ---
- name: create .hgrc if necessary
stat: path={{ hgrc }}
register: st
- file: path={{ hgrc }} owner={{ botuser }} state=touch
when: not st.stat.exists
- name: enable mercurial purge extension
ini_file: dest={{ hgrc }}
section=extensions option=hgext.purge
value=
- name: install buildbot-slave in virtualenv
pip: name=buildbot-slave virtualenv={{ venv }}
- name: create buildbot environment
command: "{{ venv }}/bin/buildslave create-slave --relocatable
{{ work }} buildbot.scons.org:9989 {{ builder }} {{ pass }}
creates={{ work }}"
|