# How to sync over directories that exist locally?

**URL:** <https://forum.ansible.com/t/how-to-sync-over-directories-that-exist-locally/16063>\
**Category:** Ansible Project\
**Created:** [August 28, 2014, 4:56pm UTC](https://forum.ansible.com/t/how-to-sync-over-directories-that-exist-locally/16063 "2014-08-28T16:56:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tim.soderstrom](https://avatars.discourse-cdn.com/v4/letter/t/8e7dd6/32.png) [@tim.soderstrom](https://forum.ansible.com/u/tim.soderstrom)\
**Post date:** [August 28, 2014, 4:56pm UTC](https://forum.ansible.com/t/how-to-sync-over-directories-that-exist-locally/16063/1 "2014-08-28T16:56:09Z")

</div>

I am trying to do something like this:

- name: setup user home directories  
synchronize: src=homes/{{item.username}} dest=/home/{{item.username}}  
owner={{item.username}}  
group={{item.username}}  
with\_items: ssh\_users  
ignore\_errors: yes

So basically, I want it to copy a home directory for users that have one. Not everyone will have one because not everyone really needs, say, their own customized .vimrc, etc. In those cases, I’d like Ansible to just skip it. But I don’t know how to do that. Running the above gives me:

TASK: […/users | setup user home directories] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [default] =\> input file not found at //roles/users/files/homes/ or /roles/users/homes/

FATAL: all hosts have already failed – aborting

This looks a bit like this bug, [https://github.com/ansible/ansible/issues/7354](https://github.com/ansible/ansible/issues/7354) but they aren’t doing exactly the same thing I was trying to do.

This was all in 1.7.1.

Any ideas or suggestions?

Thanks!

Tim

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [August 28, 2014, 5:11pm UTC](https://forum.ansible.com/t/how-to-sync-over-directories-that-exist-locally/16063/2 "2014-08-28T17:11:50Z")

</div>

Hi Tim,

We were unable to reproduce the above situation, and this message is different, it’s basically saying that the input is missing. So to me this seems like a new, but unreported issue.

ignore\_errors basically only deals with the return of the module, so what I think we need to do here is explicitly check ignore\_errors in the action plugin when the files are missing, so that this can work. Long story short is action\_plugins are fiddly beasts that don’t always have all the native behavior for things like ‘ignore\_errors’ and we occasionally have to make those work with some extra code.

If you would like to open a new ticket in GitHub we can take care of this.

The temporary workaround might be to put a “.dir” file or something in each directory, so it can find something to transfer, though I agree that’s not obvious or optimal long term.

–Michael
