Differences between systems

17 views
Skip to first unread message

Tom Christopher

unread,
Jan 11, 2017, 8:55:56 PM1/11/17
to Ansible Project
Trying to set_fact based on user input:

     - set_fact:
         wls_bounce_jvm: True
       when: bounce_managed_instance == True and deploy == True

On my Mac OSX system running version 2.1.2.0.1_0 and 2.2.0.0.1_0 works without issue.

If I run the same code on RHEL 6 version 2.1.0.0-1

The fact doesn't get set, keeps skipping.

I have tried putting it all these different ways:

     - set_fact:
         wls_bounce_jvm: True
       when: bounce_managed_instance and deploy

and 

     - set_fact:
         wls_bounce_jvm: True
       when: ( bounce_managed_instance == True ) and ( deploy == True )

When I had it set to "when: bounce_managed_instance and deploy" it started setting it to True but when I changed bounce_managed_instance to False it still kept returning True.

I don't understand how it can be working differently between systems.

Has anyone else experienced this problem?


Johannes Kastl

unread,
Jan 12, 2017, 5:02:33 AM1/12/17
to ansible...@googlegroups.com
On 11.01.17 22:18 Tom Christopher wrote:
> Trying to set_fact based on user input:
>
> - set_fact:
> wls_bounce_jvm: True
> when: bounce_managed_instance == True and deploy == True

Are these boolean variables or are they set to the string "True" (with
a capital T)? If the latter, then quote both like this:

when: 'bounce_managed_instance == "True" and deploy == "True" '


> On my Mac OSX system running version 2.1.2.0.1_0 and 2.2.0.0.1_0 works
> without issue.
>
> If I run the same code on RHEL 6 version 2.1.0.0-1
>
> The fact doesn't get set, keeps skipping.

Add two debug tasks directly before your task and try again.

- debug: var="bounce_managed_instance"
- debug: var="deploy"
- set_fact:
...

My guess is that you are missing the quotes.

Johannes

signature.asc
Reply all
Reply to author
Forward
0 new messages