# copy result of a find command using register

**URL:** <https://forum.ansible.com/t/copy-result-of-a-find-command-using-register/23182>\
**Category:** Ansible Project\
**Created:** [December 6, 2016, 2:54pm UTC](https://forum.ansible.com/t/copy-result-of-a-find-command-using-register/23182 "2016-12-06T14:54:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stewart.paul](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@stewart.paul](https://forum.ansible.com/u/stewart.paul)\
**Post date:** [December 6, 2016, 2:54pm UTC](https://forum.ansible.com/t/copy-result-of-a-find-command-using-register/23182/1 "2016-12-06T14:54:39Z")

</div>

Hello,

I have placed below tasks in a role. It works fine when executing the complete role, but when i run my playbook and I include a tag “-- tags copy\_files”, my registered “result\_files” is not included.  
What would be the best approach for this where I only use run my playbook with the copy\_files tag?

- name: Register - Copy files  
command: “find ./demo\_deploy -type f ! -path ‘./demo\_deploy/ins/\*’”  
register: result\_files

- name: Copy files  
command: cp {{ item }} /tmp/  
with\_items:

- “{{result\_files.stdout\_lines}}”  
tags:

- copy\_filesed
