using assemble with large files?

25 views
Skip to first unread message

Timothy Appnel

unread,
May 22, 2013, 10:42:49 PM5/22/13
to ansible...@googlegroups.com
Was the assemble module designed to cap the size of the files it works with?

I was scripting something with Ansible today that had to grab a bunch of large files (logs) on remote servers and then concatenate them. I thought using the assemble module would be slicker than "shell cat >>" but on closer inspection the final file was truncated. Everything seemed to run fine. When I looked at the code I saw the assemble build the file in memory before writing it. Is limiting assemble to small files by design or is that something I should work up a patch to correct?

<tim/>

-- 
Timothy Appnel

Michael DeHaan

unread,
May 22, 2013, 11:10:35 PM5/22/13
to ansible...@googlegroups.com
assemble is basically there to simulate conf.d file structures in applications that do not support conf.d, merely that.

I won't say it's by design though, so patches to make it awesome would be totally welcome.




--
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.
 
 



--
Michael DeHaan <mic...@ansibleworks.com>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

Timothy Appnel

unread,
May 23, 2013, 5:37:52 PM5/23/13
to ansible...@googlegroups.com, ansible...@googlegroups.com

I used this patch here to assemble a 9gb log file where before it died silently around 2gb. 

Bonus: the code is smaller afterwards. 

<tim/>

Sent from my iPhone

Michael DeHaan

unread,
May 23, 2013, 5:40:40 PM5/23/13
to ansible...@googlegroups.com
Outstanding!

BTW, looks like you may have a tab on line 79.


Timothy Appnel

unread,
May 23, 2013, 6:21:00 PM5/23/13
to ansible...@googlegroups.com, ansible...@googlegroups.com
Hum. Not picking up on the tab in my code here. The tmp.write line there is indented the correct amount. 


<tim/>

Sent from my iPhone

Michael DeHaan

unread,
May 23, 2013, 7:16:20 PM5/23/13
to ansible...@googlegroups.com
Might just be github formatting, I'll check, thanks!


Reply all
Reply to author
Forward
0 new messages