blob: 016951e2ec8b8f1b3bf13ee56edebbc947f78963 [file] [log] [blame]
Andy Baviercccf27b2015-08-17 14:48:29 -04001---
Andy Bavier22552302015-10-22 12:44:40 -04002- hosts: head
Andy Baviercccf27b2015-08-17 14:48:29 -04003 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
Andy Baviercccf27b2015-08-17 14:48:29 -040013 - name: Add nova-compute relations
14 script: scripts/juju-compute-relations.py
15
Andy Bavier52017142015-10-05 15:01:36 -040016 - name: Wait until relations are added
17 script: scripts/wait-for-services.sh
Andy Baviercccf27b2015-08-17 14:48:29 -040018
19# Play: set up ansible-pull for OpenCloud-specific files on nova-compute nodes
Andy Bavier22552302015-10-22 12:44:40 -040020- hosts: compute
Andy Baviercccf27b2015-08-17 14:48:29 -040021 sudo: yes
22 vars:
23
24 # schedule is fed directly to cron
25 schedule: '*/15 * * * *'
26
27 # User to run ansible-pull as from cron
28 cron_user: root
29
30 # File that ansible will use for logs
31 logfile: /var/log/ansible-pull.log
32
33 # Directory to where repository will be cloned
34 workdir: /var/lib/ansible/local
35
36 # Repository to check out
37 # repo must contain a local.yml file at top level
38 #repo_url: git://github.com/sfromm/ansible-playbooks.git
39 repo_url: git://github.com/andybavier/opencloud-nova-compute-ansible.git
40
41 # Branch or tag to checkout
Andy Bavierc0c96ee2015-09-22 18:21:56 -040042 repo_version: kilo
Andy Baviercccf27b2015-08-17 14:48:29 -040043
44 tasks:
45
Andy Baviercccf27b2015-08-17 14:48:29 -040046 - name: Install ansible
47 apt: name=ansible state=installed
48
49 - name: Basic ansible inventory
50 template: src=templates/etc/ansible/hosts.j2
51 dest=/etc/ansible/hosts
52
53 - name: Create local directory to work from
54 file: path={{workdir}} state=directory owner=root group=root mode=0751
55
56 - name: Create crontab entry to clone/pull git repository
57 template: src=templates/etc/cron.d/ansible-pull.j2 dest=/etc/cron.d/ansible-pull owner=root group=root mode=0644
58
59 - name: Create logrotate entry for ansible-pull.log
60 template: src=templates/etc/logrotate.d/ansible-pull.j2 dest=/etc/logrotate.d/ansible-pull owner=root group=root mode=0644