Zack Williams | 573bafc | 2016-02-26 16:35:42 -0700 | [diff] [blame^] | 1 | --- |
| 2 | # roles/juju-setup/main/tasks.yml |
| 3 | |
| 4 | - name: Verify that we can log into every VM |
| 5 | command: ansible services -m ping -u ubuntu |
| 6 | |
| 7 | - name: Initialize Juju |
| 8 | command: juju generate-config |
| 9 | creates={{ ansible_env['PWD'] }}/.juju/environments.yaml |
| 10 | |
| 11 | - name: Juju config file |
| 12 | template: |
| 13 | src=environments.yaml.j2 |
| 14 | dest={{ ansible_env['PWD'] }}/.juju/environments.yaml |
| 15 | |
| 16 | - name: Bootstrap Juju |
| 17 | command: juju bootstrap |
| 18 | creates={{ ansible_env['PWD'] }}/.juju/environments/manual.jenv |
| 19 | |
| 20 | - name: Copy openstack.cfg for Juju |
| 21 | become: yes |
| 22 | copy: |
| 23 | src=openstack.cfg |
| 24 | dest=/usr/local/src/openstack.cfg |
| 25 | |
| 26 | - name: Get Juju machine status |
| 27 | command: juju status --format=json |
| 28 | register: juju_status_json |
| 29 | |
| 30 | - name: Add Juju status to ansible facts |
| 31 | set_fact: juju_status="{{ juju_status_json.stdout | from_json }}" |
| 32 | |
| 33 | |