From 871e52bfd86e547ab3eb3f40b148a1ba29604355 Mon Sep 17 00:00:00 2001 From: Sagi Shnaidman Date: Wed, 20 Nov 2024 17:52:53 +0200 Subject: [PATCH] Fix ansible linter --- .ansible-lint | 12 +++++++++++- .github/workflows/ansible-lint.yml | 2 +- ansible-requirements.yaml | 5 ----- galaxy.yml | 3 +++ meta/runtime.yml | 2 +- playbooks/performance_profile.yml | 15 +++++++-------- roles/performance_profile/tasks/main.yml | 2 +- 7 files changed, 24 insertions(+), 17 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index 9406e34..c10e9ac 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,6 +1,16 @@ mock_roles: - rhtelco.automation.hyperv - rhtelco.automation.hv_provision + exclude_paths: - playbooks/_*.yml - # - roles/ + - roles/storage + +skip_list: + - skip_this_tag + +warn_list: + - fqcn[action-core] + - galaxy[no-changelog] + - var-naming[no-role-prefix] + - name[play] diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index ccaad44..308dc91 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -16,4 +16,4 @@ jobs: args: "-c .ansible-lint" setup_python: "true" working_directory: "" - requirements_file: "" + requirements_file: "ansible-requirements.yaml" diff --git a/ansible-requirements.yaml b/ansible-requirements.yaml index 115ea60..862846b 100644 --- a/ansible-requirements.yaml +++ b/ansible-requirements.yaml @@ -7,8 +7,3 @@ collections: version: 5.0.0 - name: kubevirt.core # Utilized in deploy_manager_vm role version: 2.1.0 - -roles: - - name: storage # for managing storage on HV - src: https://github.com/linux-system-roles/storage - version: 1.8.1 diff --git a/galaxy.yml b/galaxy.yml index bda4276..5edd216 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -9,6 +9,9 @@ license: tags: - automation - telco + - infrastructure + - linux + - tools dependencies: {} repository: https://github.com/openshift-kni/telco-ci documentation: https://github.com/openshift-kni/telco-ci diff --git a/meta/runtime.yml b/meta/runtime.yml index ccb4d51..6000ee3 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -1 +1 @@ -requires_ansible: ">=2.8" +requires_ansible: ">=2.15.0" diff --git a/playbooks/performance_profile.yml b/playbooks/performance_profile.yml index 0afa8ad..d7102ca 100644 --- a/playbooks/performance_profile.yml +++ b/playbooks/performance_profile.yml @@ -1,5 +1,4 @@ --- -## # This playbook applies performance profile configmap to # hosted cluster nodes. # Note: Currently this playbook assumes there is only one @@ -10,13 +9,13 @@ # Provide # kubeconfig path of the management clusters example: /home/kni/hcp-jobs/sno-cnfqe1/config/kubeconfig # -#ansible-playbook -vv playbooks/performance_profile.yml -e kubeconfig=/home/kni/hcp-jobs/sno-cnfqe1/config/kubeconfig -## +# ansible-playbook -vv playbooks/performance_profile.yml -e kubeconfig=/home/kni/hcp-jobs/sno-cnfqe1/config/kubeconfig - hosts: localhost tasks: - - name: Apply performance profile - vars: - pp_kubeconfig: "{{ kubeconfig }}" - include_role: - name: performance_profile + + - name: Apply performance profile + vars: + pp_kubeconfig: "{{ kubeconfig }}" + include_role: + name: performance_profile diff --git a/roles/performance_profile/tasks/main.yml b/roles/performance_profile/tasks/main.yml index f4ba767..1e726a3 100644 --- a/roles/performance_profile/tasks/main.yml +++ b/roles/performance_profile/tasks/main.yml @@ -59,7 +59,7 @@ namespace: "{{ nodepool_namespace }}" spec: tuningConfig: - - name: "{{ performance_configmap_name }}" + - name: "{{ performance_configmap_name }}" - name: Check if Nodepool is updating kubernetes.core.k8s_info: