diff --git a/ansible/playbooks/roles/rook/tasks/main.yml b/ansible/playbooks/roles/rook/tasks/main.yml index 0a74498fa7..efca053aa6 100644 --- a/ansible/playbooks/roles/rook/tasks/main.yml +++ b/ansible/playbooks/roles/rook/tasks/main.yml @@ -21,29 +21,49 @@ - "{{ rook_helm_chart_file_name }}" - "{{ rook_helm_cluster_chart_file_name }}" - - name: Create configuration for operator Helm chart file (operator-custom-chart-values.yml) + - name: Create custom configuration for operator Helm chart file (operator-custom-chart-values.yml) + when: specification.operator_chart_values is defined copy: content: "{{ specification.operator_chart_values }}" dest: "{{ download_directory }}/operator-custom-chart-values.yml" mode: preserve - - name: Create configuration for cluster Helm chart file (cluster-custom-chart-values.yml) + - name: Create custom configuration for cluster Helm chart file (cluster-custom-chart-values.yml) + when: specification.cluster_chart_values is defined copy: content: "{{ specification.cluster_chart_values }}" dest: "{{ download_directory }}/cluster-custom-chart-values.yml" mode: preserve - name: Install Rook operator using Helm chart with values from operator-custom-chart-values.yml + when: specification.operator_chart_values is defined command: | helm -n {{ specification.rook_namespace }} upgrade --install \ -f {{ download_directory }}/operator-custom-chart-values.yml \ {{ rook_helm_chart_name }} \ {{ download_directory }}/{{ rook_helm_chart_file_name }} --create-namespace + - name: Install Rook operator using Helm chart with default values + when: not specification.operator_chart_values is defined + command: | + helm -n {{ specification.rook_namespace }} upgrade --install \ + {{ rook_helm_chart_name }} \ + {{ download_directory }}/{{ rook_helm_chart_file_name }} --create-namespace + - name: Create Rook cluster with values from cluster-custom-chart-values.yml + when: specification.cluster_chart_values is defined command: | helm -n {{ specification.rook_namespace }} upgrade --install \ --set operatorNamespace={{ specification.rook_namespace }} \ -f {{ download_directory }}/cluster-custom-chart-values.yml \ {{ rook_helm_cluster_chart_name }} \ {{ download_directory }}/{{ rook_helm_cluster_chart_file_name }} --create-namespace + + - name: Create Rook cluster with default values + when: not specification.cluster_chart_values is defined + command: | + helm -n {{ specification.rook_namespace }} upgrade --install \ + --set operatorNamespace={{ specification.rook_namespace }} \ + {{ rook_helm_cluster_chart_name }} \ + {{ download_directory }}/{{ rook_helm_cluster_chart_file_name }} --create-namespace + diff --git a/schema/common/defaults/configuration/rook.yml b/schema/common/defaults/configuration/rook.yml index d41401bbec..f61ce6d3f9 100644 --- a/schema/common/defaults/configuration/rook.yml +++ b/schema/common/defaults/configuration/rook.yml @@ -3,214 +3,5 @@ kind: configuration/rook title: "Kubernetes Rook Config" name: default specification: - rook_namespace: rook-ceph - enabled: false - operator_chart_values: - crds: - enabled: true - resources: - limits: - cpu: 500m - memory: 256Mi - requests: - cpu: 100m - memory: 128Mi - nodeSelector: {} - tolerations: [] - unreachableNodeTolerationSeconds: 5 - currentNamespaceOnly: false - annotations: {} - logLevel: INFO - rbacEnable: true - pspEnable: true - csi: - enableRbdDriver: true - enableCephfsDriver: true - enableGrpcMetrics: false - enableCephfsSnapshotter: true - enableRBDSnapshotter: true - enablePluginSelinuxHostMount : false - rbdFSGroupPolicy: "ReadWriteOnceWithFSType" - cephFSFSGroupPolicy: "ReadWriteOnceWithFSType" - enableOMAPGenerator: false - provisionerReplicas: 2 - allowUnsupportedVersion: false - forceCephFSKernelClient: true - volumeReplication: - enabled: false - csiAddons: - enabled: false - enableDiscoveryDaemon: false - cephCommandsTimeoutSeconds: "15" - enableSelinuxRelabeling: true - hostpathRequiresPrivileged: false - disableDeviceHotplug: false - discoverDaemonUdev: - enableOBCWatchOperatorNamespace: true - admissionController: - monitoring: - enabled: false - cluster_chart_values: - operatorNamespace: rook-ceph - toolbox: - enabled: false - image: rook/ceph:v1.8.8 - tolerations: [] - affinity: {} - resources: {} - monitoring: - enabled: false - rulesNamespaceOverride: - pspEnable: true - cephClusterSpec: - cephVersion: - image: quay.io/ceph/ceph:v16.2.7 - allowUnsupported: false - dataDirHostPath: /var/lib/rook - skipUpgradeChecks: false - continueUpgradeAfterChecksEvenIfNotHealthy: false - waitTimeoutForHealthyOSDInMinutes: 10 - mon: - count: 3 - allowMultiplePerNode: false - mgr: - count: 1 - modules: - - name: pg_autoscaler - enabled: true - dashboard: - enabled: true - ssl: true - crashCollector: - disable: false - cleanupPolicy: - confirmation: "" - sanitizeDisks: - method: quick - dataSource: zero - iteration: 1 - allowUninstallWithVolumes: false - removeOSDsIfOutAndSafeToRemove: false - storage: - useAllNodes: true - useAllDevices: true - disruptionManagement: - managePodBudgets: true - osdMaintenanceTimeout: 30 - pgHealthCheckTimeout: 0 - manageMachineDisruptionBudgets: false - machineDisruptionBudgetNamespace: openshift-machine-api - healthCheck: - daemonHealth: - mon: - disabled: false - interval: 45s - osd: - disabled: false - interval: 60s - status: - disabled: false - interval: 60s - livenessProbe: - mon: - disabled: false - mgr: - disabled: false - osd: - disabled: false - ingress: - dashboard: {} - cephBlockPools: - - name: ceph-blockpool - spec: - failureDomain: host - replicated: - size: 3 - storageClass: - enabled: true - name: ceph-block - isDefault: true - reclaimPolicy: Delete - allowVolumeExpansion: true - mountOptions: [] - parameters: - imageFormat: "2" - imageFeatures: layering - csi.storage.k8s.io/provisioner-secret-name: rook-csi-rbd-provisioner - csi.storage.k8s.io/provisioner-secret-namespace: rook-ceph - csi.storage.k8s.io/controller-expand-secret-name: rook-csi-rbd-provisioner - csi.storage.k8s.io/controller-expand-secret-namespace: rook-ceph - csi.storage.k8s.io/node-stage-secret-name: rook-csi-rbd-node - csi.storage.k8s.io/node-stage-secret-namespace: rook-ceph - csi.storage.k8s.io/fstype: ext4 - cephFileSystems: - - name: ceph-filesystem - spec: - metadataPool: - replicated: - size: 3 - dataPools: - - failureDomain: host - replicated: - size: 3 - name: data0 - metadataServer: - activeCount: 1 - activeStandby: true - storageClass: - enabled: true - isDefault: false - name: ceph-filesystem - pool: data0 - reclaimPolicy: Delete - allowVolumeExpansion: true - mountOptions: [] - parameters: - csi.storage.k8s.io/provisioner-secret-name: rook-csi-cephfs-provisioner - csi.storage.k8s.io/provisioner-secret-namespace: rook-ceph - csi.storage.k8s.io/controller-expand-secret-name: rook-csi-cephfs-provisioner - csi.storage.k8s.io/controller-expand-secret-namespace: rook-ceph - csi.storage.k8s.io/node-stage-secret-name: rook-csi-cephfs-node - csi.storage.k8s.io/node-stage-secret-namespace: rook-ceph - csi.storage.k8s.io/fstype: ext4 - cephFileSystemVolumeSnapshotClass: - enabled: false - name: ceph-filesystem - isDefault: true - deletionPolicy: Delete - annotations: {} - labels: {} - parameters: {} - cephBlockPoolsVolumeSnapshotClass: - enabled: false - name: ceph-block - isDefault: false - deletionPolicy: Delete - annotations: {} - labels: {} - parameters: {} - cephObjectStores: - - name: ceph-objectstore - spec: - metadataPool: - failureDomain: host - replicated: - size: 3 - dataPool: - failureDomain: host - erasureCoded: - dataChunks: 2 - codingChunks: 1 - preservePoolsOnDelete: true - gateway: - port: 80 - instances: 1 - healthCheck: - bucket: - interval: 60s - storageClass: - enabled: true - name: ceph-bucket - reclaimPolicy: Delete - parameters: - region: us-east-1 + rook_namespace: rook-ceph + enabled: false