Andy Bavier | 50f9a53 | 2016-11-17 11:05:56 -0800 | [diff] [blame] | 1 | # run another time, so services will be in juju_services list |
| 2 | - name: Obtain Juju Facts after service creation |
| 3 | juju_facts: |
| 4 | register: result |
| 5 | until: result | success |
| 6 | retries: 3 |
| 7 | delay: 15 |
| 8 | |
| 9 | # 1800s = 30m. Usually takes 10-12m on cloudlab for relations to come up |
| 10 | # Only checks for first port in list |
| 11 | - name: Wait for juju services to have open ports |
| 12 | wait_for: |
| 13 | host={{ item.name }} |
| 14 | port={{ item.forwarded_ports[0].int }} |
| 15 | timeout=1800 |
| 16 | with_items: "{{ head_lxd_list | selectattr('forwarded_ports', 'defined') | list }}" |
| 17 | |
| 18 | # secondary wait, as waiting on ports isn't enough. Probably only need one of these... |
| 19 | # 160*15s = 2400s = 40m max wait |
| 20 | - name: Wait for juju services to start |
| 21 | command: juju status --format=summary |
| 22 | register: juju_summary |
| 23 | until: juju_summary.stdout.find("pending:") == -1 |
| 24 | retries: 160 |
| 25 | delay: 15 |
| 26 | tags: |
| 27 | - skip_ansible_lint # checking/waiting on a system to be up |
| 28 | |
| 29 | - name: Create admin-openrc.sh credentials file |
| 30 | template: |
| 31 | src=admin-openrc.sh.j2 |
| 32 | dest={{ ansible_user_dir }}/admin-openrc.sh |
| 33 | |
| 34 | - name: Copy nova-cloud-controller CA certificate to head |
| 35 | command: juju scp {{ juju_services['nova-cloud-controller']['units'].keys()[0] }}:/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt {{ ansible_user_dir }} |
| 36 | register: result |
| 37 | until: result | success |
| 38 | retries: 40 |
| 39 | delay: 15 |
| 40 | tags: |
| 41 | - skip_ansible_lint # checking/waiting on file availibilty |
| 42 | |
| 43 | - name: Copy cert to system location |
| 44 | become: yes |
| 45 | copy: |
| 46 | src: "{{ ansible_user_dir }}/keystone_juju_ca_cert.crt" |
| 47 | dest: "/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt" |
| 48 | remote_src: true |
| 49 | notify: |
| 50 | - update-ca-certificates |
| 51 | - Move cert to all service VMs |
| 52 | - update-ca-certificates in service VMs |