Differences between systems

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?

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