# Copy module

**URL:** <https://forum.ansible.com/t/copy-module/26914>\
**Category:** Ansible Project\
**Created:** [March 6, 2018, 9:05pm UTC](https://forum.ansible.com/t/copy-module/26914 "2018-03-06T21:05:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Malcolm\_Hussain-Gamb](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@Malcolm\_Hussain-Gamb](https://forum.ansible.com/u/Malcolm_Hussain-Gamb)\
**Post date:** [March 6, 2018, 9:05pm UTC](https://forum.ansible.com/t/copy-module/26914/1 "2018-03-06T21:05:15Z")

</div>

I'm using ansible to build a package in Jenkins and the make an rpm.  
The copy function takes 20+ minutes to copy a few files. Using the command function takes under a second.  
The synchronize function is generally unusable (better off using rsync from command)

I was wondering what other people's experiences are with copy and synchronize.

---

<div class="post-metadata">

**Author:** ![Malcolm\_Hussain-Gamb](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@Malcolm\_Hussain-Gamb](https://forum.ansible.com/u/Malcolm_Hussain-Gamb)\
**Post date:** [March 7, 2018, 7:03pm UTC](https://forum.ansible.com/t/copy-module/26914/2 "2018-03-07T19:03:36Z")

</div>

After further investigation it appears there are a lot of serious short comings using ansible directly to build an rpm.  
It looks like it's not a fault with ansible per say, just how I'm trying to (ab)use it.  
The thought occurs about writing an ansible module to make rpms.  
Would there be wider interest in this?

---

<div class="post-metadata">

**Author:** ![senorsmile](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/senorsmile/32/9024_2.png) [@senorsmile](https://forum.ansible.com/u/senorsmile)\
**Post date:** [March 7, 2018, 7:09pm UTC](https://forum.ansible.com/t/copy-module/26914/3 "2018-03-07T19:09:16Z")

</div>

I have had great success with the synchronize module as of Ansible 2.4.

In my opinion, your use case sounds like reasoning to create a custom module.

---

<div class="post-metadata">

**Author:** ![Thijn\_Bukkems](https://avatars.discourse-cdn.com/v4/letter/t/ac91a4/32.png) [@Thijn\_Bukkems](https://forum.ansible.com/u/Thijn_Bukkems)\
**Post date:** [March 7, 2018, 8:49pm UTC](https://forum.ansible.com/t/copy-module/26914/4 "2018-03-07T20:49:30Z")

</div>

My copy speeds greatly increased when I moved the package source to the same datacenter as the target resources. Could it be a location issue where your network speed gets throttled?

---

<div class="post-metadata">

**Author:** ![Malcolm\_Hussain-Gamb](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@Malcolm\_Hussain-Gamb](https://forum.ansible.com/u/Malcolm_Hussain-Gamb)\
**Post date:** [March 8, 2018, 5:55pm UTC](https://forum.ansible.com/t/copy-module/26914/5 "2018-03-08T17:55:24Z")

</div>

It's not a network issue. Local and remote are localhost.  
The speed issues seem to be down to abuse of ansible.  
Just to process the files dictionary list into a sensible format took over three hours (I gave up) and used 12Gb of ram.  
Using a shell script takes less than a second.  
Ansible is doing a lot of checks, that in this instance are pointless.  
There is a lot of manipulation of data as well, that would be far easier in python too.  
So a module to make an rpm I think is the way to go.
