Assemble module idea

114 views
Skip to first unread message

Tin Tvrtković

unread,
Jul 8, 2013, 7:58:33 PM7/8/13
to ansible...@googlegroups.com
Hello,

currently the assemble module takes a source directory as a parameter. How about adding an option of passing a list of file names to it in addition?

name: Assemble my .vimrc
assemble: dest=~/.vimrc files={{ file_list }}

where file_list would be an array var, or maybe tie it in with a with_items? Would this even be possible and/or desirable? Maybe the source directory param could even be reduced to a with_fileglob.

Michael DeHaan

unread,
Jul 8, 2013, 8:35:39 PM7/8/13
to ansible...@googlegroups.com
Is the issue that the directory contains some files you do not wish to assemble?





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

Tin Tvrtković

unread,
Jul 9, 2013, 3:49:32 AM7/9/13
to ansible...@googlegroups.com
I'd like to offer users a library of snippets, in a special directory. They could then cherry pick from those snippets somehow and the snippets would get assembled into one file.

Initially I thought I would do the assembling on the controlling machine, then transfer the result. Now it occurs to me I can just take a list of snippets, ship them off to the server (using with_items) and assemble them there.

But even disregarding my current problem, is this idea something that looks interesting to you? I'd be willing to put some work into it if it's feasible.

Michael DeHaan

unread,
Jul 9, 2013, 9:10:53 PM7/9/13
to ansible...@googlegroups.com
I'm open to having it work differently if it were passed a comma delimited list of files.

A small change will be need to be made to runner so with_items can feed it "items" and it will listify, if that makes sense, as "with_items" is a clearer way to pass it along.

This is how the yum and apt module install multiple packages in a single transaction.

Let me know if I need to explain further, search for yum in the runner/__init__.py code and you will see what I mean about how this works for those!


Zachary Buckholz

unread,
Jun 10, 2015, 4:58:06 PM6/10/15
to ansible...@googlegroups.com
Was there ever any further traction on the assemble module taking a list of files using "with_items"? To documentation still states it uses a directory.

Thanks
Zach
Reply all
Reply to author
Forward
0 new messages