Copy module

33 views
Skip to first unread message

Malcolm Hussain-Gambles

unread,
Mar 6, 2018, 4:05:15 PM3/6/18
to Ansible Project
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.

Malcolm Hussain-Gambles

unread,
Mar 7, 2018, 2:03:36 PM3/7/18
to Ansible Project
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?

senorsmile

unread,
Mar 7, 2018, 2:09:16 PM3/7/18
to Ansible Project
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. 

Thijn Bukkems

unread,
Mar 7, 2018, 3:49:31 PM3/7/18
to Ansible Project
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? 

Malcolm Hussain-Gambles

unread,
Mar 8, 2018, 12:55:24 PM3/8/18
to Ansible Project
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.
Reply all
Reply to author
Forward
0 new messages