Zack Williams | c047c87 | 2017-01-11 08:38:15 -0700 | [diff] [blame] | 1 | --- |
| 2 | # juju-finish/tasks/main.yml |
| 3 | |
Andy Bavier | 50f9a53 | 2016-11-17 11:05:56 -0800 | [diff] [blame] | 4 | # run another time, so services will be in juju_services list |
| 5 | - name: Obtain Juju Facts after service creation |
| 6 | juju_facts: |
| 7 | register: result |
| 8 | until: result | success |
| 9 | retries: 3 |
| 10 | delay: 15 |
| 11 | |
| 12 | # 1800s = 30m. Usually takes 10-12m on cloudlab for relations to come up |
| 13 | # Only checks for first port in list |
| 14 | - name: Wait for juju services to have open ports |
| 15 | wait_for: |
| 16 | host={{ item.name }} |
| 17 | port={{ item.forwarded_ports[0].int }} |
| 18 | timeout=1800 |
| 19 | with_items: "{{ head_lxd_list | selectattr('forwarded_ports', 'defined') | list }}" |
| 20 | |
| 21 | # secondary wait, as waiting on ports isn't enough. Probably only need one of these... |
| 22 | # 160*15s = 2400s = 40m max wait |
| 23 | - name: Wait for juju services to start |
| 24 | command: juju status --format=summary |
| 25 | register: juju_summary |
| 26 | until: juju_summary.stdout.find("pending:") == -1 |
| 27 | retries: 160 |
| 28 | delay: 15 |
| 29 | tags: |
| 30 | - skip_ansible_lint # checking/waiting on a system to be up |
| 31 | |
| 32 | - name: Create admin-openrc.sh credentials file |
| 33 | template: |
| 34 | src=admin-openrc.sh.j2 |
Andy Bavier | a6cffe1 | 2017-03-15 17:33:42 -0400 | [diff] [blame^] | 35 | dest="{{ item }}/admin-openrc.sh" |
| 36 | with_items: |
| 37 | - "{{ ansible_user_dir }}" |
| 38 | - "{{ cord_profile_dir }}" |