Zack Williams | f40f3ce | 2016-03-01 22:01:28 -0700 | [diff] [blame] | 1 | --- |
| 2 | # roles/juju-openstack-config/main/tasks.yml |
| 3 | |
| 4 | - name: Obtain keystone admin password |
| 5 | command: "juju run --unit={{ juju_services['keystone']['units'].keys()[0] }} 'sudo cat /var/lib/keystone/keystone.passwd'" |
| 6 | register: keystone_password |
| 7 | |
| 8 | - name: Obtain keystone IP address |
| 9 | command: uvt-kvm ip keystone |
| 10 | register: keystone_ip |
| 11 | |
| 12 | - name: Create admin-openrc.sh credentials file |
| 13 | template: |
| 14 | src=admin-openrc.sh.j2 |
| 15 | dest={{ ansible_user_dir }}/admin-openrc.sh |
| 16 | |
| 17 | - name: Copy credentials file to nova-cloud-controller |
| 18 | command: "scp {{ ansible_user_dir }}/admin-openrc.sh ubuntu@nova-cloud-controller:" |
| 19 | |
| 20 | - name: Copy network setup script |
| 21 | become: yes |
| 22 | copy: |
| 23 | src=network-setup.sh |
| 24 | dest=/usr/local/src/network-setup.sh |
| 25 | mode=0644 owner=root |
| 26 | |
| 27 | - name: Run network setup script |
| 28 | command: ansible nova-cloud-controller -m script -u ubuntu -a "/usr/local/src/network-setup.sh" |
| 29 | |
| 30 | - name: Copy nova-cloud-controller CA certificate to local |
| 31 | become: yes |
| 32 | command: juju scp {{ juju_services['nova-cloud-controller']['units'].keys()[0] }}:/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt \ |
| 33 | /usr/local/share/ca-certificates |
| 34 | creates=/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt |
| 35 | notify: update-ca-certificates |
| 36 | |