From f2b8784b177e7d2f5c65d90e6fbc4e04e3e42562 Mon Sep 17 00:00:00 2001 From: Kamini Singh Date: Thu, 21 May 2026 00:23:03 +0530 Subject: [PATCH 1/2] ansible-lint test --- galaxy.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/galaxy.yml b/galaxy.yml index 9fde177..2cafd9c 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -72,5 +72,4 @@ build_ignore: [] # L(directives,https://packaging.python.org/en/latest/guides/using-manifest-in/#manifest-in-commands). The key # 'omit_default_directives' is a boolean that controls whether the default directives are used. Mutually exclusive # with 'build_ignore' -# manifest: null -# Test message \ No newline at end of file +# manifest: null \ No newline at end of file From 8311e5a7fc24b85c0c5dd29b316dc1d5f7f8150f Mon Sep 17 00:00:00 2001 From: Kamini Singh Date: Thu, 21 May 2026 09:08:58 +0530 Subject: [PATCH 2/2] ansible-lint fixes --- galaxy.yml | 2 +- roles/create_pvcs/tasks/main.yml | 2 +- roles/create_storageclass/tasks/main.yml | 2 +- roles/create_storageclass/tests/test.yml | 2 +- roles/create_volume_snapshotclass/tasks/main.yml | 2 +- roles/create_volume_snapshots/tasks/main.yml | 16 ++++++++-------- roles/delete_pvcs/tasks/main.yml | 2 +- roles/delete_storageclass/tasks/main.yml | 2 +- roles/delete_volume_snapshotclass/tasks/main.yml | 2 +- roles/delete_volume_snapshots/tasks/main.yml | 2 +- roles/set_default_storageclass/tasks/main.yml | 6 +++--- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/galaxy.yml b/galaxy.yml index 2cafd9c..7be6229 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -72,4 +72,4 @@ build_ignore: [] # L(directives,https://packaging.python.org/en/latest/guides/using-manifest-in/#manifest-in-commands). The key # 'omit_default_directives' is a boolean that controls whether the default directives are used. Mutually exclusive # with 'build_ignore' -# manifest: null \ No newline at end of file +# manifest: null diff --git a/roles/create_pvcs/tasks/main.yml b/roles/create_pvcs/tasks/main.yml index c8ac6b5..0335a30 100644 --- a/roles/create_pvcs/tasks/main.yml +++ b/roles/create_pvcs/tasks/main.yml @@ -12,7 +12,7 @@ - name: Define anchor for OpenShift/Kubernetes API login info ansible.builtin.set_fact: - k8s_auth: &k8s_auth + create_pvcs_k8s_auth: &k8s_auth host: "{{ create_pvcs_oc_api_url | default(omit) }}" api_key: "{{ create_pvcs_oc_api_token | default(omit) }}" validate_certs: "{{ create_pvcs_validate_certs | default(false) }}" diff --git a/roles/create_storageclass/tasks/main.yml b/roles/create_storageclass/tasks/main.yml index d6ac708..f3c088c 100644 --- a/roles/create_storageclass/tasks/main.yml +++ b/roles/create_storageclass/tasks/main.yml @@ -11,7 +11,7 @@ - name: Define anchor for OpenShift/Kubernetes API login info ansible.builtin.set_fact: - k8s_auth: &k8s_auth + create_storageclass_k8s_auth: &k8s_auth host: "{{ create_storageclass_oc_api_url | default(omit) }}" api_key: "{{ create_storageclass_oc_api_token | default(omit) }}" validate_certs: "{{ create_storageclass_validate_certs | default(false) }}" diff --git a/roles/create_storageclass/tests/test.yml b/roles/create_storageclass/tests/test.yml index 00745d2..a71f68d 100644 --- a/roles/create_storageclass/tests/test.yml +++ b/roles/create_storageclass/tests/test.yml @@ -34,4 +34,4 @@ sc_reclaim_policy: Delete sc_volume_binding_mode: Immediate roles: - - create_storageclass \ No newline at end of file + - create_storageclass diff --git a/roles/create_volume_snapshotclass/tasks/main.yml b/roles/create_volume_snapshotclass/tasks/main.yml index 885f128..f4e7447 100644 --- a/roles/create_volume_snapshotclass/tasks/main.yml +++ b/roles/create_volume_snapshotclass/tasks/main.yml @@ -12,7 +12,7 @@ - name: Define anchor for OpenShift/Kubernetes API login info ansible.builtin.set_fact: - k8s_auth: &k8s_auth + create_volume_snapshotclass_k8s_auth: &k8s_auth host: "{{ create_volume_snapshotclass_oc_api_url | default(omit) }}" api_key: "{{ create_volume_snapshotclass_oc_api_token | default(omit) }}" validate_certs: "{{ create_volume_snapshotclass_validate_certs | default(false) }}" diff --git a/roles/create_volume_snapshots/tasks/main.yml b/roles/create_volume_snapshots/tasks/main.yml index 8612561..09fe34d 100644 --- a/roles/create_volume_snapshots/tasks/main.yml +++ b/roles/create_volume_snapshots/tasks/main.yml @@ -14,7 +14,7 @@ - name: Define anchor for OpenShift/Kubernetes API login info ansible.builtin.set_fact: - k8s_auth: &k8s_auth + create_volume_snapshots_k8s_auth: &k8s_auth host: "{{ create_volume_snapshots_oc_api_url | default(omit) }}" api_key: "{{ create_volume_snapshots_oc_api_token | default(omit) }}" validate_certs: "{{ create_volume_snapshots_validate_certs | default(false) }}" @@ -44,7 +44,7 @@ kind: PersistentVolumeClaim namespace: "{{ create_volume_snapshots_pvc_namespace | default('') }}" api_version: v1 - register: existing_pvcs + register: create_volume_snapshots_existing_pvcs tags: - k8s_create_volume_snapshots @@ -67,9 +67,9 @@ when: - item.snapshot_name is defined and item.snapshot_name != "" - item.pvc_name is defined and item.pvc_name != "" - - existing_pvcs is defined - - existing_pvcs.resources is defined - - item.pvc_name in (existing_pvcs.resources | map(attribute='metadata.name') | list) + - create_volume_snapshots_existing_pvcs is defined + - create_volume_snapshots_existing_pvcs.resources is defined + - item.pvc_name in (create_volume_snapshots_existing_pvcs.resources | map(attribute='metadata.name') | list) tags: - k8s_create_volume_snapshots @@ -82,10 +82,10 @@ '{{ create_volume_snapshots_pvc_namespace | default('') }}' loop: "{{ create_volume_snapshots_volume_snapshot_specs | default([]) }}" when: - - existing_pvcs is defined - - existing_pvcs.resources is defined + - create_volume_snapshots_existing_pvcs is defined + - create_volume_snapshots_existing_pvcs.resources is defined - item.snapshot_name is defined and item.snapshot_name != "" - item.pvc_name is defined and item.pvc_name != "" - - item.pvc_name not in (existing_pvcs.resources | map(attribute='metadata.name') | list) + - item.pvc_name not in (create_volume_snapshots_existing_pvcs.resources | map(attribute='metadata.name') | list) tags: - k8s_create_volume_snapshots diff --git a/roles/delete_pvcs/tasks/main.yml b/roles/delete_pvcs/tasks/main.yml index 790a42c..a218519 100644 --- a/roles/delete_pvcs/tasks/main.yml +++ b/roles/delete_pvcs/tasks/main.yml @@ -12,7 +12,7 @@ - name: Define anchor for OpenShift/Kubernetes API login info ansible.builtin.set_fact: - k8s_auth: &k8s_auth + delete_pvcs_k8s_auth: &k8s_auth host: "{{ delete_pvcs_oc_api_url | default(omit) }}" api_key: "{{ delete_pvcs_oc_api_token | default(omit) }}" validate_certs: "{{ delete_pvcs_validate_certs | default(false) }}" diff --git a/roles/delete_storageclass/tasks/main.yml b/roles/delete_storageclass/tasks/main.yml index 03a8ee1..2279dda 100644 --- a/roles/delete_storageclass/tasks/main.yml +++ b/roles/delete_storageclass/tasks/main.yml @@ -11,7 +11,7 @@ - name: Define anchor for OpenShift/Kubernetes API login info ansible.builtin.set_fact: - k8s_auth: &k8s_auth + delete_storageclass_k8s_auth: &k8s_auth host: "{{ delete_storageclass_oc_api_url | default(omit) }}" api_key: "{{ delete_storageclass_oc_api_token | default(omit) }}" validate_certs: "{{ delete_storageclass_validate_certs | default(false) }}" diff --git a/roles/delete_volume_snapshotclass/tasks/main.yml b/roles/delete_volume_snapshotclass/tasks/main.yml index 0ce1fa2..b998cca 100644 --- a/roles/delete_volume_snapshotclass/tasks/main.yml +++ b/roles/delete_volume_snapshotclass/tasks/main.yml @@ -12,7 +12,7 @@ - name: Define anchor for OpenShift/Kubernetes API login info ansible.builtin.set_fact: - k8s_auth: &k8s_auth + delete_volume_snapshotclass_k8s_auth: &k8s_auth host: "{{ delete_volume_snapshotclass_oc_api_url | default(omit) }}" api_key: "{{ delete_volume_snapshotclass_oc_api_token | default(omit) }}" validate_certs: "{{ delete_volume_snapshotclass_validate_certs | default(false) }}" diff --git a/roles/delete_volume_snapshots/tasks/main.yml b/roles/delete_volume_snapshots/tasks/main.yml index c4076bc..93e7a38 100644 --- a/roles/delete_volume_snapshots/tasks/main.yml +++ b/roles/delete_volume_snapshots/tasks/main.yml @@ -13,7 +13,7 @@ - name: Define anchor for OpenShift/Kubernetes API login info ansible.builtin.set_fact: - k8s_auth: &k8s_auth + delete_volume_snapshots_k8s_auth: &k8s_auth host: "{{ delete_volume_snapshots_oc_api_url | default(omit) }}" api_key: "{{ delete_volume_snapshots_oc_api_token | default(omit) }}" validate_certs: "{{ delete_volume_snapshots_validate_certs | default(false) }}" diff --git a/roles/set_default_storageclass/tasks/main.yml b/roles/set_default_storageclass/tasks/main.yml index 98df161..427bcea 100644 --- a/roles/set_default_storageclass/tasks/main.yml +++ b/roles/set_default_storageclass/tasks/main.yml @@ -12,7 +12,7 @@ - name: Define anchor for OpenShift/Kubernetes API login info ansible.builtin.set_fact: - k8s_auth: &k8s_auth + set_default_storageclass_k8s_auth: &k8s_auth host: "{{ set_default_storageclass_oc_api_url | default(omit) }}" api_key: "{{ set_default_storageclass_oc_api_token | default(omit) }}" validate_certs: "{{ set_default_storageclass_validate_certs | default(false) }}" @@ -38,7 +38,7 @@ <<: *k8s_auth kind: StorageClass api_version: storage.k8s.io/v1 - register: existing_storage_classes + register: set_default_storageclass_existing_storage_classes tags: - k8s_set_default_storage_class @@ -55,7 +55,7 @@ metadata: annotations: storageclass.kubernetes.io/is-default-class: "false" - loop: "{{ existing_storage_classes.resources | default([]) }}" + loop: "{{ set_default_storageclass_existing_storage_classes.resources | default([]) }}" when: - item.metadata.annotations is defined - item.metadata.annotations['storageclass.kubernetes.io/is-default-class'] is defined