Skip to content

sap_hypervisor_node_preconfigure: Fix ansible-lint errors #101

@marcelmamula

Description

@marcelmamula

1. Error: fqcn[action-core]: Use FQCN for builtin module actions (ansible.builtin.yum).

Problem

roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/allocate-hugepages-at-runtime.yml:2
Use `ansible.builtin.dnf` or `ansible.legacy.dnf` instead.

Solution

Review and fix wrong module ansible.builtin.yum.

2. Error: syntax-check[missing-file]: Unable to retrieve file contents

Problem

syntax-check[missing-file]: Unable to retrieve file contents
roles/sap_hypervisor_node_preconfigure:1:1 Could not find or access '/tmp/platform/main.yml' on the Ansible Controller.

Reason:

The variable sap_hypervisor_node_preconfigure_platform is undefined, causing ansible-lint to blindly search /tmp/ folder for files.

Solution

  1. Add default value, like sap_hypervisor_node_preconfigure_platform: 'ENTER_STRING_VALUE_HERE'
  2. Add Assert task into main.yml file that will ensure that role will proceed only if `that: sap_hypervisor_node_preconfigure_platform in ['ibmpower_phyp', 'redhat_ocp_virt', 'redhat_rhel_kvm', 'vmware_vsphere']

3. Update .ansible-lint

Update linting configuration to remove exclusion for this role. These errors cannot be ignored forever.

exclude_paths:
  - roles/sap_hypervisor_node_preconfigure

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions