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.
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.ymltask file called frommain.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:
configure_nic_irq_affinityrole.Benefits to SEAPATH
It would sanitise role inputs, which improves debugging when a role is misused.
Work to be done