utils/templates/test_module*.yml.in: Use generic module_defaults
The usage of module_defaults allows to reduce the size of the tests and to have the needed information in the tasks only. The default values for the parameters are automatically passed to the module by Ansible. It is not possible to use a module group for module_defaults as this could only be done with Ansible Collections. The tests are also used upstream and downstream without a collection. Without groups of a collection it is needed to add the defaults for all modules separately. Simple example: module_defaults: ipahost: ipaadmin_password: SomeADMINpassword ipaapi_context: "{{ ipa_context | default(omit) }}" Several module example using YAML anchors and aliases: module_defaults: ipahost: &ipa_module_defaults ipaadmin_password: SomeADMINpassword ipaapi_context: "{{ ipa_context | default(omit) }}" ipauser: *ipa_module_defaults ipagroup: *ipa_module_defaults
Loading
Please register or sign in to comment