Add Shared Storage as optional 92/5492/4
authorIgnacio Pascual <ignacio.pascual.pelayo@ericsson.com>
Wed, 22 Jul 2020 13:57:51 +0000 (15:57 +0200)
committerIgnacio Pascual <ignacio.pascual.pelayo@ericsson.com>
Wed, 22 Jul 2020 14:54:52 +0000 (16:54 +0200)
In some setups there will be no shared storage configured.
The current playbooks will always create a cephfs Storage Class,
this change will make it optional and controlled from a variable.

Change-Id: I70a57e50cd0ecdc4ac300d46e1d269ebcb90a5aa

apps/ceph/kubespray/playbooks/roles/common/vars/main.yml
apps/ceph/kubespray/playbooks/roles/install/tasks/main.yaml

index 933075ae554e0a7fe3d23bf61d3b35c2afd0282a..bc0decb67bb2c05d93279a65f9e83ac8cdc13cbe 100644 (file)
@@ -31,5 +31,6 @@ rook_block_pool_replicas: 1
 rook_block_storage_name: "block-storage"
 rook_block_storage_fs: "xfs"
 
+rook_filesystem: "{{ lookup('env', 'ROOK_FS') | default('false', true) }}"
 rook_filesystem_name: "rookfs"
 rook_filesystem_storageclass_name: "csi-cephfs"
index b977018025287c576a429692c0f62c11c0269e37..6d3a676aa0d2c91bc1a7c923ea18ddfff8ead747 100644 (file)
   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: