ignore_errors doesn't work with copy?

376 views
Skip to first unread message

Bryan Larsen

unread,
Jun 3, 2013, 10:09:37 AM6/3/13
to ansible...@googlegroups.com
I wanted to do a copy IFF the src exists.   I thought this would work:

- copy: src=../../../../shared/secrets.json dest=/srv/clara/shared/secrets.json backup=yes
  ignore_errors: yes

This fails with

fatal: [127.0.0.1] => input file not found at /home/rof/clara/shared/secrets.json or /shared/secrets.json

FATAL: all hosts have already failed -- aborting

Is this a typo on my part, working as expected, or a bug?

thanks,
Bryan

Michael DeHaan

unread,
Jun 3, 2013, 11:20:41 AM6/3/13
to ansible...@googlegroups.com
>
Is this a typo on my part, working as expected, or a bug?

It's a bug -- though also working as expected -- as I never expected anyone to try this :)

ignore_errors was put there to ignore the return codes in modules returns, not in fatal errors that happen in processing the input, like missing local files.   But I can't see any reason why it shouldn't work as you say.

Please file a ticket on github and we can make this work as you suggest.   The template module should also be similarly modified.






--
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-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Renaud Guerin

unread,
Jul 31, 2015, 7:43:50 AM7/31/15
to Ansible Project, michael...@gmail.com
Hi, has this ever been implemented ?

I'm hitting this same problem with the unarchive module, but anything that checks for local files really, should be affected.
Reply all
Reply to author
Forward
0 new messages