kwoodson / ansible-role-yedit

Ansible Role for Yaml editing
164 stars 62 forks source link

Set 'value' type to noop validator #92

Open benjamb opened 2 years ago

benjamb commented 2 years ago

If the type of an argument is not set, ansible defaults to treating it as a string. As such it gets run through a validator that converts the value to a string via str().

In the case of 'value' being null, or perhaps a dict or list that contained null, the conversion via str() would cause the python native None to be passed to this module, which when parsed through yaml.safe_load() in parse_value(), would return the string 'None'.

To fix this, we set the type of 'value' to a noop validator, as the type may vary and we don't want ansible to perform any conversion.