From 7352573c78f1048c5772947b9ba3cb443749bb26 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 29 May 2024 10:24:56 -0600 Subject: [PATCH] really fix linter --- .../openshift/roles/cluster_config/README.md | 16 ++++++++-------- .../templates/operators/catalog_source.j2 | 3 +-- .../templates/operators/namespace.yml.j2 | 4 ++-- .../templates/operators/operator_group.yml.j2 | 2 +- .../templates/operators/subscription.yml.j2 | 2 +- .../roles/cluster_config/tests/inventory | 1 - 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/collections/ansible_collections/demo/openshift/roles/cluster_config/README.md b/collections/ansible_collections/demo/openshift/roles/cluster_config/README.md index 460d26c0a..aa2dda5c6 100644 --- a/collections/ansible_collections/demo/openshift/roles/cluster_config/README.md +++ b/collections/ansible_collections/demo/openshift/roles/cluster_config/README.md @@ -58,7 +58,7 @@ The task `operators/operator_config.yaml` needs following variables: - **Variable Name**: `cluster_config_operators` - **Type**: List - **Description**: A list of operators to be installed on OCP cluster -- **Variable Name**: `cluster_config_[OPERATOR_NAME]` +- **Variable Name**: `cluster_config_[OPERATOR_NAME]` - **Type**: Dict - **Description**: Configuration specific to each operator listed in `cluster_config_operators`. Includes settings for namespace, operator group, subscription, and any extra resources - **Example**: Assume the `cluster_config_operators` specifies these operators: @@ -71,11 +71,11 @@ The task `operators/operator_config.yaml` needs following variables: ```yaml cluster_config_cnv_namespace: openshift-cnv cluster_config_cnv: - namespace: + namespace: name: "{{ cluster_config_cnv_namespace }}" operator_group: name: kubevirt-hyperconverged-group - target_namespaces: + target_namespaces: - "{{ cluster_config_cnv_namespace }}" subscription: name: kubevirt-hyperconverged @@ -88,18 +88,18 @@ The task `operators/operator_config.yaml` needs following variables: namespace: "{{ cluster_config_cnv_namespace }}" spec: BareMetalPlatform: true - + cluster_config_oadp_namespace: openshift-adp cluster_config_oadp: - namespace: + namespace: name: "{{ cluster_config_oadp_namespace }}" operator_group: name: redhat-oadp-operator-group - target_namespaces: + target_namespaces: - "{{ cluster_config_oadp_namespace }}" subscription: name: redhat-oadp-operator-subscription - spec_name: redhat-oadp-operator + spec_name: redhat-oadp-operator ``` Dependencies ------------ @@ -115,7 +115,7 @@ An example of configuring a CatalogSource resource: hosts: localhost gather_facts: false tasks: - - ansible.builtin.include_role: + - ansible.builtin.include_role: name: cluster_config tasks_from: operators/catalog_sources ``` diff --git a/collections/ansible_collections/demo/openshift/roles/cluster_config/templates/operators/catalog_source.j2 b/collections/ansible_collections/demo/openshift/roles/cluster_config/templates/operators/catalog_source.j2 index c2dafb102..861198c75 100644 --- a/collections/ansible_collections/demo/openshift/roles/cluster_config/templates/operators/catalog_source.j2 +++ b/collections/ansible_collections/demo/openshift/roles/cluster_config/templates/operators/catalog_source.j2 @@ -13,7 +13,7 @@ spec: priority: {{ item.priority }} {% endif -%} {% if item.grpc_pod_config is defined -%} - grpcPodConfig: + grpcPodConfig: {{ item.grpc_pod_config | indent(4) }} {% endif -%} {% if item.icon is defined -%} @@ -32,4 +32,3 @@ spec: registryPoll: interval: {{ item.registry_poll_interval }} {% endif -%} - diff --git a/collections/ansible_collections/demo/openshift/roles/cluster_config/templates/operators/namespace.yml.j2 b/collections/ansible_collections/demo/openshift/roles/cluster_config/templates/operators/namespace.yml.j2 index 9736a06ad..bab8e19d7 100644 --- a/collections/ansible_collections/demo/openshift/roles/cluster_config/templates/operators/namespace.yml.j2 +++ b/collections/ansible_collections/demo/openshift/roles/cluster_config/templates/operators/namespace.yml.j2 @@ -3,8 +3,8 @@ kind: Namespace metadata: name: {{ _operator.namespace.name }} {% if _operator.namespace.labels is defined %} - labels: + labels: {% for key, value in _operator.namespace.labels.items() -%} {{ key }}: "{{ value }}" {% endfor -%} -{% endif -%} \ No newline at end of file +{% endif -%} diff --git a/collections/ansible_collections/demo/openshift/roles/cluster_config/templates/operators/operator_group.yml.j2 b/collections/ansible_collections/demo/openshift/roles/cluster_config/templates/operators/operator_group.yml.j2 index 22a9f9b0e..6c1a0ca39 100644 --- a/collections/ansible_collections/demo/openshift/roles/cluster_config/templates/operators/operator_group.yml.j2 +++ b/collections/ansible_collections/demo/openshift/roles/cluster_config/templates/operators/operator_group.yml.j2 @@ -9,4 +9,4 @@ spec: {% for item in _operator.operator_group.target_namespaces %} - {{ item }} {% endfor %} - {% endif -%} \ No newline at end of file + {% endif -%} diff --git a/collections/ansible_collections/demo/openshift/roles/cluster_config/templates/operators/subscription.yml.j2 b/collections/ansible_collections/demo/openshift/roles/cluster_config/templates/operators/subscription.yml.j2 index c7d6dd451..9cd7b9d08 100644 --- a/collections/ansible_collections/demo/openshift/roles/cluster_config/templates/operators/subscription.yml.j2 +++ b/collections/ansible_collections/demo/openshift/roles/cluster_config/templates/operators/subscription.yml.j2 @@ -11,4 +11,4 @@ spec: sourceNamespace: {{ _operator.subscription.source_namespace | d('openshift-marketplace', true) }} {% if _operator.subscription.starting_csv is defined %} startingCSV: {{ _operator.subscription.starting_csv }} -{% endif -%} \ No newline at end of file +{% endif -%} diff --git a/collections/ansible_collections/demo/openshift/roles/cluster_config/tests/inventory b/collections/ansible_collections/demo/openshift/roles/cluster_config/tests/inventory index 878877b07..2fbb50c4a 100644 --- a/collections/ansible_collections/demo/openshift/roles/cluster_config/tests/inventory +++ b/collections/ansible_collections/demo/openshift/roles/cluster_config/tests/inventory @@ -1,2 +1 @@ localhost -