On 28. des. 2016 00:39, Cann wrote:
I have dynamic variable that includes specific playbook during run time. I
don't want my ansible to fail if variable is not defined.
I tried to use ignore_errors statement but it does not work for some
reason.
Example:
# add worker specific settings
- include: tasks/{{ worker_type }}.yml
ignore_errors: yes
- include: tasks/{{ worker_type }}.yml
when: worker_type is defined
Error message:
TASK [ServerSetup/server : include]
********************************************
fatal: [35.166.201.62]: FAILED! => {"failed": true, "reason": "the
file_name '/Users/admin/dev/ansible/tasks/image-worker.yml' does not exist,
or is not readable"}
This message indicate that the variable is defined but the file doesn't
exist.
So what is it that you actually want?
--
Kai Stian Olstad
--
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/eca86035-459e-d7f9-585e-e4cc741dbf51%40olstad.com.
For more options, visit https://groups.google.com/d/optout.