Ingress Nginx Integration
[infra/stack/kubernetes.git] / apps / ceph / kubespray / playbooks / roles / install / tasks / main.yaml
index 90fb05b65c7024ee2cbfc08798e885f794d4d37f..56242ee02e728533e5f619e1ae18c39dbe02a4a9 100644 (file)
@@ -37,7 +37,7 @@
 
 - name: Delete existing rook cluster CRD if any
   k8s:
-    api_version: apiextensions.k8s.io/v1beta1
+    api_version: apiextensions.k8s.io/v1
     state: absent
     kind: CustomResourceDefinition
     name: cephclusters.ceph.rook.io
@@ -51,6 +51,7 @@
   with_items:
     - operator.yaml.j2
     - common.yaml.j2
+    - crds.yaml.j2
   loop_control:
     loop_var: config_file
   ignore_errors: true
   delay: 5
   tags: reset
 
+- name: label storage nodes  # noqa 305
+  shell: "kubectl label node {{ item }} {{ rook_storage_label }}=true"
+  changed_when: true
+  with_items: "{{ rook_storage_nodes }}"
+
+- name: taint storage nodes  # noqa 305
+  shell: "kubectl taint node {{ item }} {{ rook_storage_label }}=true:NoSchedule"
+  changed_when: true
+  with_items: "{{ rook_storage_nodes }}"
+
+- name: label nodes for other workloads  # noqa 305
+  shell: "kubectl label node {{ item }} {{ rook_storage_label }}=false"
+  changed_when: true
+  with_items: "{{ rook_nostorage_nodes }}"
+
 - name: Create rook operator
   k8s:
     state: present
     definition: "{{ lookup('template', config_file) }}"
   with_items:
+    - crds.yaml.j2
     - common.yaml.j2
     - operator.yaml.j2
   loop_control:
     - rook_mgr_status.resources is defined
     - rook_mgr_status.resources
   retries: 20
-  delay: 5
+  delay: 10
 
 - name: Create rook cluster
   k8s:
   with_items:
     - pool.yaml.j2
     - storageclass.yaml.j2
+  loop_control:
+    loop_var: config_file
+
+- name: Create rook file system
+  k8s:
+    state: present
+    definition: "{{ lookup('template', config_file) }}"
+  with_items:
     - filesystem.yaml.j2
     - filesystem-storageclass.yaml.j2
   loop_control:
     loop_var: config_file
+  when: rook_filesystem|bool
 
 - name: Create rook external dashboard
   k8s:
     state: present
     definition: "{{ lookup('template', 'external-dashboard-https.yaml.j2') }}"
+  when: rook_ceph_dashboard_enabled|bool
 
 # vim: set ts=2 sw=2 expandtab: