blob: c5bc3dafc4628920f653c0c2ad3e3f5e2a4cc445 (
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
|
# Ansible playbook to setup buildbot instance
# http://scons.org/wiki/InstallingBuildbotSlaves
#
# ansible-playbook -i buildbot.hosts buildbot.yml -e 'botuser=scons'
#
# Tested with Ansible 1.5.0. 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
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 }} backup=yes
section=extensions option=hgext.purge
value=
# --- setup virtualenv for buildbot ---
- name: setup buildbot-virtualenv
command: /usr/bin/virtualenv --no-site-packages {{ venv }}
creates={{ venv }}/bin
|