From eaa22aad8af64f3c4167339a983a9aa5b2a14b97 Mon Sep 17 00:00:00 2001 From: Prajyot-Parab Date: Thu, 3 Mar 2022 16:10:46 +0530 Subject: [PATCH] CSI Driver configurations playbook Signed-off-by: Prajyot-Parab --- examples/csi_driver_config_vars.yaml | 18 ++++++++ playbooks/csi_driver_config.yaml | 5 +++ playbooks/roles/csi-driver-config/README.md | 45 +++++++++++++++++++ .../roles/csi-driver-config/tasks/main.yaml | 14 ++++++ 4 files changed, 82 insertions(+) create mode 100644 examples/csi_driver_config_vars.yaml create mode 100644 playbooks/csi_driver_config.yaml create mode 100644 playbooks/roles/csi-driver-config/README.md create mode 100644 playbooks/roles/csi-driver-config/tasks/main.yaml diff --git a/examples/csi_driver_config_vars.yaml b/examples/csi_driver_config_vars.yaml new file mode 100644 index 00000000..1f8a51b0 --- /dev/null +++ b/examples/csi_driver_config_vars.yaml @@ -0,0 +1,18 @@ +--- +service_instance_id: "bc895dc9-f626-41c0-bfd3-94a0d8942a5f" #IBM Cloud PowerVS service instance id +region: "mon" #IBM Cloud PowerVS service instance region +zone: "mon01" #IBM Cloud PowerVS service instance zone + +masters: + - name: "mon01-master-0.rdr-pd-410.redhat.com" #OCP Nodes Master name + id: "03c203dc-814f-4e61-88c1-6af4cb6d2e3d" #OCP Nodes Master instance id + - name: "mon01-master-1.rdr-pd-410.redhat.com" + id: "0b67d0c2-339f-45ee-95b3-9b6d7c7524ef" + - name: "mon01-master-2.rdr-pd-410.redhat.com" + id: "38d98bb1-fb58-4ca8-a1c0-a7fb60625716" + +workers: + - name: "mon01-worker-0.rdr-pd-410.redhat.com" #OCP Nodes Worker name + id: "e24feb20-a962-49a9-9a24-1fe19861f81e" #OCP Nodes Worker instance id + - name: "mon01-worker-1.rdr-pd-410.redhat.com" + id: "e24feb20-a962-49a9-9a24-1fe19861f81e" diff --git a/playbooks/csi_driver_config.yaml b/playbooks/csi_driver_config.yaml new file mode 100644 index 00000000..8bab6683 --- /dev/null +++ b/playbooks/csi_driver_config.yaml @@ -0,0 +1,5 @@ +--- +- name: CSI Driver configuration + hosts: bastion[0] + roles: + - csi-driver-config diff --git a/playbooks/roles/csi-driver-config/README.md b/playbooks/roles/csi-driver-config/README.md new file mode 100644 index 00000000..09a190cd --- /dev/null +++ b/playbooks/roles/csi-driver-config/README.md @@ -0,0 +1,45 @@ +csi-driver-config: PowerVS Block CSI Driver Configuration +========= + +This module will perform necessary configuration on OCP nodes required for CSI Driver installation. + +Requirements +------------ + + - A working OCP 4.X cluster + +Role Variables +-------------- + +| Variable | Required | Default | Comments | +|--------------------------------|----------|---------|---------------------------------------------------------------| +| service_instance_id | yes | | IBM Cloud PowerVS service instance id. | +| region | yes | | IBM Cloud PowerVS service instance region. eg. mon | +| zone | yes | | IBM Cloud PowerVS service instance zone. eg. mon01 | +| masters.name | yes | | OCP Nodes Master name. | +| masters.id | yes | | OCP Nodes Master instance id. | +| workers.name | yes | | OCP Nodes Worker name. | +| workers.id | yes | | OCP Nodes Worker instance id. | + +Dependencies +------------ + + - None + +Example Playbook +---------------- + + - name: CSI Driver configuration + hosts: bastion + roles: + - csi-driver-config + +License +------- + +See LICENCE.txt + +Author Information +------------------ + +Prajyot Parab (prajyot.parab2@ibm.com) diff --git a/playbooks/roles/csi-driver-config/tasks/main.yaml b/playbooks/roles/csi-driver-config/tasks/main.yaml new file mode 100644 index 00000000..6cb8890a --- /dev/null +++ b/playbooks/roles/csi-driver-config/tasks/main.yaml @@ -0,0 +1,14 @@ +--- +# tasks file for csi driver configuration + +- name: Set providerID spec for OCP Nodes + k8s: + state: present + kind: Node + name: "{{ item.name }}" + definition: + spec: + providerID: ibmpowervs://{{ region }}/{{ zone }}/{{ service_instance_id }}/{{ item.id }} + with_items: + - "{{ masters | lower }}" + - "{{ workers | lower }}"