Not tried myself but I wonder if you could use failed_when to reduce the
boilerplate a little:
http://docs.ansible.com/ansible/playbooks_error_handling.html#controlling-what-defines-failure
Something like this (as I say, untested):
---
- hosts: all
name: testing
tasks:
- name: print variable
action: debug msg="Does variable exist [{{ ansible_check_mode }}]"
- name: Make symlink
action: file src="/ohwhat/hai" dest="/there/youare" state=link
register: symlinkresult
failed_when: "{{ not ( ansible_check_mode) and (symlinkresult |
failed) }}"
>
>
--
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/8f32973a-d834-44f9-987a-6ce655d5c60a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.