Thank you all for the answers. I used the solution "from_yaml" provided by
Vladimir and it works like a charm, and it's also cleaner. However, if this
is the case, I don't believe this is an issue of how ternary works, but of
how "from_json" works. My gut feeling is that it shouldn't behave that
On Thu, Mar 26, 2020 at 7:55 AM Davide Scrimieri wrote:
>
> Hello,
>
> Whenever a ternary is used are both conditions evaluated regardless ?
>
> For example, I want to convert "my_other_var" to an object only if it is
> passed as as string, otherwise I don't want to touch the object, and leave
On Wed, 25 Mar 2020 23:54:57 -0700 (PDT)
Davide Scrimieri wrote:
> I want to convert "my_other_var" to an object only if it is
> passed as as string, otherwise I don't want to touch the object, and leave
> it as it is.
>
> - set_fact:
> my_var: "{{ ( my_other_var | type_debug == 'str' )