Skip to content

Add variable check to every roles #950

Description

@emontmas

Current status
Currently, only a limited set of roles have a role variables validation step.
For example the configure_nic_irq_affinity role perform such check with a custom validate.yml task file called from main.yml.

Detailed Description
Generalise this validation step to every role.

Since Ansible-core 2.11, a similar feature called argument validation is built-in. It uses a specification file that describe the expected variables, their type, ... quite like in the README files, but it is also used to validate variables.

So this validation could be done either:

  • Using the same custom approach as for the configure_nic_irq_affinity role.
  • Using the built-in argument validation feature.

Benefits to SEAPATH
It would sanitise role inputs, which improves debugging when a role is misused.

Work to be done

  • Decide which approach is preferred for the project.
  • Add role variable validation in every role.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions