blob: 70bc0083c63b142a272f2d05a48b9b4a5ae62c65 [file] [log] [blame]
Andy Bavier8d51c6c2015-04-01 11:40:22 -04001---
2- hosts: singapore-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 - pause: "Wait until services have started"
11
12 - name: Add nova-compute relations
13 script: scripts/juju-compute-relations.py
14
15 - pause: "Wait until relations are added"
16
Andy Bavier8d51c6c2015-04-01 11:40:22 -040017# Play: set up ansible-pull for OpenCloud-specific files on nova-compute nodes
18- hosts: singapore-compute
19 sudo: yes
20 vars:
21
22 # schedule is fed directly to cron
23 schedule: '*/15 * * * *'
24
25 # User to run ansible-pull as from cron
26 cron_user: root
27
28 # File that ansible will use for logs
29 logfile: /var/log/ansible-pull.log
30
31 # Directory to where repository will be cloned
32 workdir: /var/lib/ansible/local
33
34 # Repository to check out
35 # repo must contain a local.yml file at top level
36 #repo_url: git://github.com/sfromm/ansible-playbooks.git
37 repo_url: git://github.com/andybavier/opencloud-nova-compute-ansible.git
38
39 tasks:
40
41 - name: Install ansible
42 apt: name=ansible state=installed
43
Andy Bavier1416aad2015-04-13 14:55:54 -040044 - name: Basic ansible inventory
45 template: src=templates/etc/ansible/hosts.j2
46 dest=/etc/ansible/hosts
47
Andy Bavier8d51c6c2015-04-01 11:40:22 -040048 - name: Create local directory to work from
49 file: path={{workdir}} state=directory owner=root group=root mode=0751
50
51 - name: Create crontab entry to clone/pull git repository
52 template: src=templates/etc/cron.d/ansible-pull.j2 dest=/etc/cron.d/ansible-pull owner=root group=root mode=0644
53
54 - name: Create logrotate entry for ansible-pull.log
55 template: src=templates/etc/logrotate.d/ansible-pull.j2 dest=/etc/logrotate.d/ansible-pull owner=root group=root mode=0644
56