--- # Copyright 2019 Nokia # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - name: create Danm CRD APIs in K8s kubectl: manifest: "{{ item }}" state: present with_fileglob: "{{ caas.danm_crd_dir }}/*" - name: get CRD names set_fact: crd_name: "{{ lookup('file', item) | from_yaml | json_query('spec.names.plural') }}" with_fileglob: "{{ caas.danm_crd_dir }}/*" register: created_crds - name: wait and check Danm CRD availability shell: "kubectl api-resources | grep {{ item.ansible_facts.crd_name }} | wc -l" register: crd_result until: crd_result.stdout == "1" retries: 60 delay: 6 with_items: "{{ created_crds.results }}"