Re: [Puppet Users] Using collections

24 views
Skip to first unread message

Jeff McCune

unread,
Oct 11, 2012, 11:03:28 AM10/11/12
to puppet...@googlegroups.com
On Oct 11, 2012, at 7:48 AM, Maarten Thibaut <mthi...@cisco.com> wrote:

Hi,

I'm trying to use collections as shown below. The files I wish to collect get populated on the client, so the puppetmaster doesn't know the contents. I.e. I need to push these files to the server, and then distribute them back to the clients:

        @@file { "/etc/ssh-keys.d/$hostname.pub":
                tag     => "ssh_pub_keys",
                require => Exec["copy_key"],
        }

        File <<| tag == 'ssh_pub_keys' |>>

But this isn't working. Do collections only work for files where the puppetmaster provides the content?

The way I've thought about collections is that they only work when the compiler has the data you want in a variable and that variable is fed into the resource's parameter value.

So the way I get data off the client and into the master is by using a custom fact. The fact gets the data into a variable, then the variable is used in the (exported) resource declaration.

Hope this helps,
-Jeff


If so, has anyone thought of any strategies to overcome this issue?

Thanks!
maarten

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/8T_SC00sFYAJ.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Maarten Thibaut

unread,
Oct 17, 2012, 2:47:44 PM10/17/12
to puppet...@googlegroups.com
Thanks Jeff! I've uploaded my solution to github and the puppet forge. For more information see

http://forge.puppetlabs.com/mthibaut/mutual_trust

Ryan Coleman

unread,
Oct 18, 2012, 12:26:31 PM10/18/12
to puppet...@googlegroups.com


On Wed, Oct 17, 2012 at 11:47 AM, Maarten Thibaut <mthi...@cisco.com> wrote:
http://forge.puppetlabs.com/mthibaut/mutual_trust

Awesome! Thank you for sharing your work on the Forge! 

--
Ryan Coleman | @ryanycoleman
Modules & Forge | Puppet Labs
Reply all
Reply to author
Forward
0 new messages