"yes" as string (not boolean)

132 views
Skip to first unread message

Wilber H

unread,
May 27, 2021, 2:44:18 PM5/27/21
to Ansible Development
Hi,

Ansible keeps casting my "yes" string variable into a boolean.  
How do I prevent it from doing that?



Regards,
Wilber H

Brian Coca

unread,
May 27, 2021, 4:49:36 PM5/27/21
to Wilber H, Ansible Development
Depends, this can happen at many points and for diff reasons, in
general `|string` filter when you consume it ensures it is a string,
if it is happening at YAML boundry quote it or use !!str


----------
Brian Coca

Brian Coca

unread,
May 27, 2021, 4:50:25 PM5/27/21
to Wilber H, Ansible Development
https://hitchdev.com/strictyaml/why/implicit-typing-removed/ <= its
the opposite of yours, but same issue


--
----------
Brian Coca

Wilber H

unread,
May 31, 2021, 9:40:43 PM5/31/21
to Ansible Development
Thanks Brian; good info. 
I ended using IFELSE conditions.

Reply all
Reply to author
Forward
0 new messages