When you put a conditional on an include ansible adds that conditional
to each task in the include. So this is the expected behavior.

On Wed, Nov 19, 2014 at 12:39 PM, John Oliver <jno...@gmail.com> wrote:
> My playbook:
>
>   - name: Get Java version
>     shell: /Library/Internet\
> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version 2>&1 | grep
> '^java' | cut -d'"' -f2
>     register: jre_ver
>   - debug: msg="{{ jre_ver.stdout }}"
>
>   - name: Install JRE 8 if necessary
>     include: jre8.yml
>     when: jre_ver.stdout != '1.8.0_25'
>     ignore_errors: true
>
>
> Result:
>
> GATHERING FACTS
> ***************************************************************
> ok: [eisbock]
>
> TASK: [Get Java version]
> ******************************************************
> changed: [eisbock]
>
> TASK: [debug msg="{{ jre_ver.stdout }}"]
> **************************************
> ok: [eisbock] => {
>     "msg": "1.8.0_25"
> }
>
> TASK: [Copy JRE 8 installer]
> **************************************************
> skipping: [eisbock]
>
> TASK: [Mount disk image]
> ******************************************************
> skipping: [eisbock]
>
> TASK: [Dismount installer]
> ****************************************************
> skipping: [eisbock]
>
> TASK: [Clean up dmg]
> **********************************************************
> skipping: [eisbock]
>
> PLAY RECAP
> ********************************************************************
> eisbock                    : ok=3    changed=1    unreachable=0    failed=0
>
>
> Why is ansible still including jre8.yml and skipping each step?  I thought
> it would just not even tough it if the conditional didn't match.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/a6adcff7-b9b2-4fc7-8266-4c9705489557%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJQqANcdOtwztNrSLt56ZZzajPy1JHfJqP3Ky4LhfwAyOSOJ_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to