Setting a None Value

77 views
Skip to first unread message

Matt Ferrante

unread,
Dec 1, 2014, 11:51:29 PM12/1/14
to ansible...@googlegroups.com
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:


Thanks,
- Matt

James Cammarata

unread,
Dec 2, 2014, 12:03:55 AM12/2/14
to ansible...@googlegroups.com
Hi Matt,

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

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/714a0549-634c-444b-9e41-c2645523635c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matt Ferrante

unread,
Dec 2, 2014, 12:10:40 AM12/2/14
to ansible...@googlegroups.com
Many thanks

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/l2zq5cF9fvk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.

To post to this group, send email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages