Remove DANM TenantConfig creation
[ta/caas-danm.git] / ansible / roles / danm_setup / tasks / main.yaml
1 ---
2 # Copyright 2019 Nokia
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 - name: create Danm CRD APIs in K8s
17   kubectl:
18     manifest: "{{ item }}"
19     state: present
20   with_fileglob: "{{ caas.danm_crd_dir }}/*"
21
22 - name: get CRD names
23   set_fact:
24     crd_name: "{{ lookup('file', item) | from_yaml | json_query('spec.names.plural') }}"
25   with_fileglob: "{{ caas.danm_crd_dir }}/*"
26   register: created_crds
27
28 - name: wait and check Danm CRD availability
29   shell: "kubectl api-resources | grep {{ item.ansible_facts.crd_name }} | wc -l"
30   register: crd_result
31   until: crd_result.stdout == "1"
32   retries: 60
33   delay: 6
34   with_items: "{{ created_crds.results }}"