Skip to content

Commit

Permalink
Fix ansible linter (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
sshnaidm authored Nov 20, 2024
1 parent 72adf1b commit 5ba4b7e
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 17 deletions.
12 changes: 11 additions & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
@@ -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]
2 changes: 1 addition & 1 deletion .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
args: "-c .ansible-lint"
setup_python: "true"
working_directory: ""
requirements_file: ""
requirements_file: "ansible-requirements.yaml"
5 changes: 0 additions & 5 deletions ansible-requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
requires_ansible: ">=2.8"
requires_ansible: ">=2.15.0"
15 changes: 7 additions & 8 deletions playbooks/performance_profile.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
##
# This playbook applies performance profile configmap to
# hosted cluster nodes.
# Note: Currently this playbook assumes there is only one
Expand All @@ -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

Check warning on line 14 in playbooks/performance_profile.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

name[play]

All plays should be named.
tasks:
- name: Apply performance profile
vars:
pp_kubeconfig: "{{ kubeconfig }}"
include_role:
name: performance_profile

- name: Apply performance profile

Check warning on line 17 in playbooks/performance_profile.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (include_role).
vars:
pp_kubeconfig: "{{ kubeconfig }}"

Check warning on line 19 in playbooks/performance_profile.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

var-naming[no-role-prefix]

Variables names from within roles should use performance_profile_ as a prefix. (vars: pp_kubeconfig)
include_role:
name: performance_profile
2 changes: 1 addition & 1 deletion roles/performance_profile/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5ba4b7e

Please sign in to comment.