problem with conditional and facts,

96 views
Skip to first unread message

Jan Mattsson

unread,
Jan 22, 2015, 9:14:50 AM1/22/15
to ansible...@googlegroups.com
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?

Brian Coca

unread,
Jan 22, 2015, 10:59:16 AM1/22/15
to ansible...@googlegroups.com
try:

when: ansible_swaptotal_mb == 2047

no quotes


--
Brian Coca

Jan Mattsson

unread,
Jan 23, 2015, 11:40:05 AM1/23/15
to ansible...@googlegroups.com
thank you...I feel ashamed that I obviously had not tried that rather obvious solution..

Brian Coca

unread,
Jan 23, 2015, 12:16:27 PM1/23/15
to ansible...@googlegroups.com
no shame, sometimes when immersed in a problem, it is hard to see the
obvious (forest/trees saying).

--
Brian Coca
Reply all
Reply to author
Forward
0 new messages