blob: 9d24c37c5d7c4d2febd7fcc0cac8d40a31feb724 [file] [log] [blame]
Zack Williamsf6cc0122018-03-30 16:00:49 -07001---
Matteo Scandolo3896c472017-08-01 13:31:42 -07002# 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 Williamsc047c872017-01-11 08:38:15 -070016# juju-finish/tasks/main.yml
17
Andy Bavier50f9a532016-11-17 11:05:56 -080018# 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 Williamsf6cc0122018-03-30 16:00:49 -070022 until: result is success
Andy Bavier50f9a532016-11-17 11:05:56 -080023 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