blob: 10713a0680de278cc27352eda7622d9c318e98fc [file] [log] [blame]
Andy Baviercccf27b2015-08-17 14:48:29 -04001---
2- hosts: cloudlab-head
3 sudo: no
4 tasks:
5 - pause: "Install nova-compute on all unused machines managed by Juju"
6
7 - name: Deploy nova-compute
8 script: scripts/juju-compute-setup.py
9
10 - name: Make sure we're using KVM
11 shell: juju set nova-compute virt-type=kvm
12
13 - pause: "Wait until services have started"
14
15 - name: Add nova-compute relations
16 script: scripts/juju-compute-relations.py
17
18 - pause: "Wait until relations are added"
19
20# Play: set up ansible-pull for OpenCloud-specific files on nova-compute nodes
21- hosts: cloudlab-compute
22 sudo: yes
23 vars:
24
25 # schedule is fed directly to cron
26 schedule: '*/15 * * * *'
27
28 # User to run ansible-pull as from cron
29 cron_user: root
30
31 # File that ansible will use for logs
32 logfile: /var/log/ansible-pull.log
33
34 # Directory to where repository will be cloned
35 workdir: /var/lib/ansible/local
36
37 # Repository to check out
38 # repo must contain a local.yml file at top level
39 #repo_url: git://github.com/sfromm/ansible-playbooks.git
40 repo_url: git://github.com/andybavier/opencloud-nova-compute-ansible.git
41
42 # Branch or tag to checkout
43 #repo_version: onlab
44
45 tasks:
46
47 - name: Set up extra space on CloudLab nodes
48 shell: /usr/testbed/bin/mkextrafs /var/lib/libvirt/images
49 creates=/var/lib/libvirt/images/lost+found
50
51 - name: Install ansible
52 apt: name=ansible state=installed
53
54 - name: Basic ansible inventory
55 template: src=templates/etc/ansible/hosts.j2
56 dest=/etc/ansible/hosts
57
58 - name: Create local directory to work from
59 file: path={{workdir}} state=directory owner=root group=root mode=0751
60
61 - name: Create crontab entry to clone/pull git repository
62 template: src=templates/etc/cron.d/ansible-pull.j2 dest=/etc/cron.d/ansible-pull owner=root group=root mode=0644
63
64 - name: Create logrotate entry for ansible-pull.log
65 template: src=templates/etc/logrotate.d/ansible-pull.j2 dest=/etc/logrotate.d/ansible-pull owner=root group=root mode=0644