Zack Williams | f6cc012 | 2018-03-30 16:00:49 -0700 | [diff] [blame] | 1 | --- |
Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 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 | |
Zack Williams | c047c87 | 2017-01-11 08:38:15 -0700 | [diff] [blame] | 16 | # juju-finish/tasks/main.yml |
| 17 | |
Andy Bavier | 50f9a53 | 2016-11-17 11:05:56 -0800 | [diff] [blame] | 18 | # run another time, so services will be in juju_services list |
| 19 | - name: Obtain Juju Facts after service creation |
| 20 | juju_facts: |
| 21 | register: result |
Zack Williams | f6cc012 | 2018-03-30 16:00:49 -0700 | [diff] [blame] | 22 | until: result is success |
Andy Bavier | 50f9a53 | 2016-11-17 11:05:56 -0800 | [diff] [blame] | 23 | retries: 3 |
| 24 | delay: 15 |
| 25 | |
| 26 | # 1800s = 30m. Usually takes 10-12m on cloudlab for relations to come up |
| 27 | # Only checks for first port in list |
| 28 | - name: Wait for juju services to have open ports |
| 29 | wait_for: |
| 30 | host={{ item.name }} |
| 31 | port={{ item.forwarded_ports[0].int }} |
| 32 | timeout=1800 |
| 33 | with_items: "{{ head_lxd_list | selectattr('forwarded_ports', 'defined') | list }}" |
| 34 | |
| 35 | # secondary wait, as waiting on ports isn't enough. Probably only need one of these... |
| 36 | # 160*15s = 2400s = 40m max wait |
| 37 | - name: Wait for juju services to start |
| 38 | command: juju status --format=summary |
| 39 | register: juju_summary |
| 40 | until: juju_summary.stdout.find("pending:") == -1 |
| 41 | retries: 160 |
| 42 | delay: 15 |
| 43 | tags: |
| 44 | - skip_ansible_lint # checking/waiting on a system to be up |
| 45 | |