# Setting a None Value

**URL:** <https://forum.ansible.com/t/setting-a-none-value/16932>\
**Category:** Ansible Project\
**Created:** [December 2, 2014, 4:51am UTC](https://forum.ansible.com/t/setting-a-none-value/16932 "2014-12-02T04:51:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Ferrante](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Matt\_Ferrante](https://forum.ansible.com/u/Matt_Ferrante)\
**Post date:** [December 2, 2014, 4:51am UTC](https://forum.ansible.com/t/setting-a-none-value/16932/1 "2014-12-02T04:51:29Z")

</div>

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](https://github.com/ansible/ansible-modules-core/pull/58)

Thanks,

- Matt

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [December 2, 2014, 5:03am UTC](https://forum.ansible.com/t/setting-a-none-value/16932/2 "2014-12-02T05:03:34Z")

</div>

Hi Matt,

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

---

<div class="post-metadata">

**Author:** ![Matt\_Ferrante](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Matt\_Ferrante](https://forum.ansible.com/u/Matt_Ferrante)\
**Post date:** [December 2, 2014, 5:10am UTC](https://forum.ansible.com/t/setting-a-none-value/16932/3 "2014-12-02T05:10:37Z")

</div>

Many thanks
