# problem with conditional and facts,

**URL:** <https://forum.ansible.com/t/problem-with-conditional-and-facts/17351>\
**Category:** Ansible Project\
**Created:** [January 22, 2015, 2:14pm UTC](https://forum.ansible.com/t/problem-with-conditional-and-facts/17351 "2015-01-22T14:14:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan\_Mattsson](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@Jan\_Mattsson](https://forum.ansible.com/u/Jan_Mattsson)\
**Post date:** [January 22, 2015, 2:14pm UTC](https://forum.ansible.com/t/problem-with-conditional-and-facts/17351/1 "2015-01-22T14:14:50Z")

</div>

I did a quick play which has a conditional:

when: ansible\_swaptotal\_mb == “2047”

this conditional never evaluates as true, if I debug:

debug: var=ansible\_swaptotal\_mb

I get

ok: [hostname] =\> {  
“ansible\_swaptotal\_mb”: “2047”  
}

it seems to me my when statement would evaluate as true?  
I have the same issue when I try “ansible\_lsb.id”

what am I doing wrong here?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 22, 2015, 3:59pm UTC](https://forum.ansible.com/t/problem-with-conditional-and-facts/17351/2 "2015-01-22T15:59:13Z")

</div>

try:

when: ansible\_swaptotal\_mb == 2047

no quotes

---

<div class="post-metadata">

**Author:** ![Jan\_Mattsson](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@Jan\_Mattsson](https://forum.ansible.com/u/Jan_Mattsson)\
**Post date:** [January 23, 2015, 4:40pm UTC](https://forum.ansible.com/t/problem-with-conditional-and-facts/17351/3 "2015-01-23T16:40:04Z")

</div>

thank you…I feel ashamed that I obviously had not tried that rather obvious solution…

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 23, 2015, 5:16pm UTC](https://forum.ansible.com/t/problem-with-conditional-and-facts/17351/4 "2015-01-23T17:16:23Z")

</div>

no shame, sometimes when immersed in a problem, it is hard to see the  
obvious (forest/trees saying).
