Russell Parsloe
2013-Mar-20 10:41 UTC
[Puppet Users] Export a file from one node and collect on another
I''m trying to use Puppet and PuppetDB to export a config file from one node, and collect it on another i.e. export */etc/app1/file1.cfg* from *node a* and collect */etc/app2/file2.cfg*on *node b*. I need the contents of file1.cfg and file2.cfg to be the same, but the paths and file names themselves are different. I cannot centralise this file as it is generated at install time by node a. Is this even possible with Puppet? Although what I am trying to do removes the concept that Puppet should centrally manage and be authoritative for things, but if I can achieve this it would be very helpful. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Felix Frank
2013-Mar-20 12:46 UTC
Re: [Puppet Users] Export a file from one node and collect on another
Hi, you could try something like @@file { ...: tag => "my-exported-file" } and on the receiver end: File<<| tag == "my-exported-file" |>> { path => "/my/different/path" } But even if that works, I''m not at all sure how sound it really is. HTH, Felix On 03/20/2013 11:41 AM, Russell Parsloe wrote:> I''m trying to use Puppet and PuppetDB to export a config file from one > node, and collect it on another i.e. > > export */etc/app1/file1.cfg* from /node a/ and collect > */etc/app2/file2.cfg* on /node b/. > > I need the contents of file1.cfg and file2.cfg to be the same, but the > paths and file names themselves are different. I cannot centralise this > file as it is generated at install time by node a. > > Is this even possible with Puppet? Although what I am trying to do > removes the concept that Puppet should centrally manage and be > authoritative for things, but if I can achieve this it would be very > helpful.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
jcbollinger
2013-Mar-20 18:04 UTC
[Puppet Users] Re: Export a file from one node and collect on another
On Wednesday, March 20, 2013 5:41:47 AM UTC-5, Russell Parsloe wrote:> > I''m trying to use Puppet and PuppetDB to export a config file from one > node, and collect it on another i.e. > > export */etc/app1/file1.cfg* from *node a* and collect * > /etc/app2/file2.cfg* on *node b*. > > I need the contents of file1.cfg and file2.cfg to be the same, but the > paths and file names themselves are different. I cannot centralise this > file as it is generated at install time by node a. > >If by "generated at install time by node a" you mean that a local process running on node a creates the file, then what you are asking for is not Puppet exported resources. Exported resources are a means for the master to record certain declarations made during the compilation of one node''s catalog so that they can later be incorporated by reference into other nodes'' catalogs. All the necessary details of the resource to be exported must therefore be known to the master -- exported resources do not collect data from clients. If, on the other hand, what you want to do is consistent with Puppet exported resources as I described them, then I think Felix''s suggestion of using property overrides at collection time will probably work fine. The only caveat is that you may find that Puppet will not let you declare a physical /etc/app1/file1.cfg on node b because of title collision with the collected resource. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Russell Parsloe
2013-Mar-26 09:23 UTC
[Puppet Users] Re: Export a file from one node and collect on another
On Wednesday, 20 March 2013 18:04:41 UTC, jcbollinger wrote:> > > On Wednesday, March 20, 2013 5:41:47 AM UTC-5, Russell Parsloe wrote: >> >> I''m trying to use Puppet and PuppetDB to export a config file from one >> node, and collect it on another i.e. >> >> export */etc/app1/file1.cfg* from *node a* and collect * >> /etc/app2/file2.cfg* on *node b*. >> >> I need the contents of file1.cfg and file2.cfg to be the same, but the >> paths and file names themselves are different. I cannot centralise this >> file as it is generated at install time by node a. >> >> > If by "generated at install time by node a" you mean that a local process > running on node a creates the file, then what you are asking for is not > Puppet exported resources. Exported resources are a means for the master > to record certain declarations made during the compilation of one node''s > catalog so that they can later be incorporated by reference into other > nodes'' catalogs. All the necessary details of the resource to be exported > must therefore be known to the master -- exported resources do not collect > data from clients. > > If, on the other hand, what you want to do is consistent with Puppet > exported resources as I described them, then I think Felix''s suggestion of > using property overrides at collection time will probably work fine. The > only caveat is that you may find that Puppet will not let you declare a > physical /etc/app1/file1.cfg on node b because of title collision with the > collected resource. > > > John > >Looks like I fall into the "not Puppet exported resources" category. I am trying to read a file on node a, throw that into PuppetDB and collect it on node b. I''ve used exported resources for many other things such as host files and Nagios config, and after your explanation, it''s now very clear in my mind what it can and cannot do. I''ll research another method - the trouble with Puppet being so good, is now I want to do everything through the use of Puppet! Thanks for the replies. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.