Setting a None Value

Is there a way to set a variable to None? I end up with the string, “None” every time.

The ec2_lc module passes instance_profile_name along to boto’s LaunchConfiguration method. Setting instance_profile_name to something works, but I am unable to set the default value for it, None. It doesn’t like False or the empty string. If there isn’t a way to set something to null, I have created a fix as part of this pull request as a workaround:

https://github.com/ansible/ansible-modules-core/pull/58

Thanks,

  • Matt

Hi Matt,

In YAML, you can use a ~ or the lower-case string null to set the equivalent of a python None.

Many thanks