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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 counter_wait_for: "{{ item.0 }}"
20 current_oam_wait_for: "{{ item.1 }}"
23 etcd_number_wait_for: "{{ counter_wait_for | int + 2 }}"
26 expexted_oam_to_run: "caas_master{{ counter_wait_for | int + 2 }}"
28 - name: wait for a running etcd on caas_master node from the next caas_master nodes
29 shell: "/usr/bin/curl https://{{ hostvars[current_oam_wait_for]['networking']['infra_internal']['ip'] }}:{{ caas.etcd_api_port }}/health --cacert /etc/etcd/ssl/ca.pem --cert /etc/etcd/ssl/etcd{{ etcd_number_wait_for }}.pem --key /etc/etcd/ssl/etcd{{ etcd_number_wait_for }}-key.pem"
31 until: ( result.stdout.find('true') != -1 ) or ( result.stdout.find('false') != -1 )
34 when: nodename | search( expexted_oam_to_run )