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 [email protected].
To post to this group, send email to [email protected].
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.