Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 1 | |
| 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | |
Zack Williams | c047c87 | 2017-01-11 08:38:15 -0700 | [diff] [blame] | 17 | --- |
| 18 | # juju-finish/tasks/main.yml |
| 19 | |
Andy Bavier | 50f9a53 | 2016-11-17 11:05:56 -0800 | [diff] [blame] | 20 | # run another time, so services will be in juju_services list |
| 21 | - name: Obtain Juju Facts after service creation |
| 22 | juju_facts: |
| 23 | register: result |
| 24 | until: result | success |
| 25 | retries: 3 |
| 26 | delay: 15 |
| 27 | |
| 28 | # 1800s = 30m. Usually takes 10-12m on cloudlab for relations to come up |
| 29 | # Only checks for first port in list |
| 30 | - name: Wait for juju services to have open ports |
| 31 | wait_for: |
| 32 | host={{ item.name }} |
| 33 | port={{ item.forwarded_ports[0].int }} |
| 34 | timeout=1800 |
| 35 | with_items: "{{ head_lxd_list | selectattr('forwarded_ports', 'defined') | list }}" |
| 36 | |
| 37 | # secondary wait, as waiting on ports isn't enough. Probably only need one of these... |
| 38 | # 160*15s = 2400s = 40m max wait |
| 39 | - name: Wait for juju services to start |
| 40 | command: juju status --format=summary |
| 41 | register: juju_summary |
| 42 | until: juju_summary.stdout.find("pending:") == -1 |
| 43 | retries: 160 |
| 44 | delay: 15 |
| 45 | tags: |
| 46 | - skip_ansible_lint # checking/waiting on a system to be up |
| 47 | |