2 # ============LICENSE_START=======================================================
3 # Copyright (C) 2019 The Nordix Foundation. All rights reserved.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # SPDX-License-Identifier: Apache-2.0
18 # ============LICENSE_END=========================================================
20 - name: Load execution mode variables
21 include_vars: "{{ execution_mode }}.yaml"
23 - name: Delete existing rook cluster if any
25 definition: "{{ lookup('template', config_file) }}"
28 - external-dashboard-https.yaml.j2
30 - storageclass.yaml.j2
38 - name: Delete existing rook cluster CRD if any
40 api_version: apiextensions.k8s.io/v1
42 kind: CustomResourceDefinition
43 name: cephclusters.ceph.rook.io
47 - name: Delete existing rook operator if any
49 definition: "{{ lookup('template', config_file) }}"
60 - name: Wait until rook namespace is deleted
63 name: "{{ rook_namespace }}"
65 until: not result.resources
70 - name: label storage nodes # noqa 305
71 shell: "kubectl label node {{ item }} {{ rook_storage_label }}=true"
73 with_items: "{{ rook_storage_nodes }}"
75 - name: taint storage nodes # noqa 305
76 shell: "kubectl taint node {{ item }} {{ rook_storage_label }}=true:NoSchedule"
78 with_items: "{{ rook_storage_nodes }}"
80 - name: label nodes for other workloads # noqa 305
81 shell: "kubectl label node {{ item }} {{ rook_storage_label }}=false"
83 with_items: "{{ rook_nostorage_nodes }}"
85 - name: Create rook operator
88 definition: "{{ lookup('template', config_file) }}"
96 - name: Implement Workaround for connectivity problem - ping all tunnels
99 definition: "{{ lookup('template', config_file) }}"
101 - ping-tunnel-workaround.yaml.j2
103 loop_var: config_file
105 - name: Wait until OPERATOR pod is available
108 namespace: "{{ rook_namespace }}"
110 - app = rook-ceph-operator
112 - status.phase=Running
113 register: rook_mgr_status
115 - rook_mgr_status.resources is defined
116 - rook_mgr_status.resources
120 - name: Create rook cluster
123 definition: "{{ lookup('template', config_file) }}"
128 loop_var: config_file
130 - name: Wait until rook cluster deployment is complete
134 namespace: "{{ rook_namespace }}"
136 - status.state = "Created"
137 register: rook_cluster_status
139 - rook_cluster_status.resources
143 - name: Wait until MGR pods are available
146 namespace: "{{ rook_namespace }}"
148 - app = rook-ceph-mgr
150 - status.phase=Running
151 register: rook_mgr_status
153 - rook_mgr_status.resources is defined
154 - rook_mgr_status.resources
158 - name: Wait until OSD pods are available
161 namespace: "{{ rook_namespace }}"
163 - app = rook-ceph-osd
165 - status.phase=Running
166 register: rook_osd_status
168 - rook_osd_status.resources is defined
169 - rook_osd_status.resources
173 - name: Create rook block storage
176 definition: "{{ lookup('template', config_file) }}"
179 - storageclass.yaml.j2
181 loop_var: config_file
183 - name: Create rook file system
186 definition: "{{ lookup('template', config_file) }}"
189 - filesystem-storageclass.yaml.j2
191 loop_var: config_file
192 when: rook_filesystem|bool
194 - name: Create rook external dashboard
197 definition: "{{ lookup('template', 'external-dashboard-https.yaml.j2') }}"
198 when: rook_ceph_dashboard_enabled|bool
200 # vim: set ts=2 sw=2 expandtab: