Tore
2010-Apr-07 13:57 UTC
[Puppet Users] Possible options to transfer information from nodes to master?
What options does puppet provide to transfer information back to puppetmaster? I just wrote a quick manifest to create files on the puppetmaster based on information from the nodes: http://pastebin.com/MyurwLrE Then it struck me, this wont work at all since (of course) the configuration is compiled locally on the master, then transfered to the nodes. Hence, all files would have the same content, but different names. I''m little stuck here, what options do I have to solve this problems? I have a few cases where just retrieving file X from all nodes would be excellent, e.g. httpd.conf, just to diff them locally to verify that no differences is present, before adding a manifest for handling that file. Does puppet have anything in stock for me here? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Christopher Webber
2010-Apr-07 14:03 UTC
Re: [Puppet Users] Possible options to transfer information from nodes to master?
This is what facter is used for. This should get you started. http://docs.puppetlabs.com/guides/custom_facts.html -- cwebber On Apr 7, 2010, at 6:57 AM, Tore wrote:> What options does puppet provide to transfer information back to > puppetmaster? > > I just wrote a quick manifest to create files on the puppetmaster > based on information from the nodes: > http://pastebin.com/MyurwLrE > > Then it struck me, this wont work at all since (of course) the > configuration is compiled locally on the master, then transfered to > the nodes. Hence, all files would have the same content, but different > names. > > I''m little stuck here, what options do I have to solve this problems? > I have a few cases where just retrieving file X from all nodes would > be excellent, e.g. httpd.conf, just to diff them locally to verify > that no differences is present, before adding a manifest for handling > that file. > > Does puppet have anything in stock for me here? > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Daniel Pittman
2010-Apr-07 14:36 UTC
Re: [Puppet Users] Possible options to transfer information from nodes to master?
Tore <tore.lonoy@gmail.com> writes:> What options does puppet provide to transfer information back to > puppetmaster?Facter, as was already pointed out, and the option of exported and imported resources if you have storeconfig enabled. However... [...]> I have a few cases where just retrieving file X from all nodes would > be excellent, e.g. httpd.conf, just to diff them locally to verify > that no differences is present, before adding a manifest for handling > that file. > > Does puppet have anything in stock for me here?...this is not something that puppet is really designed to do, as far as I am aware. So, it doesn''t really offer many tools to support this sort of discovery. I tend to use ''noop'' on the specific resource and ''puppetd --test'' on the servers, or to use our ad-hoc change tools to fetch the appropriate files back to my central system for me. Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Tore
2010-Apr-08 10:23 UTC
[Puppet Users] Re: Possible options to transfer information from nodes to master?
Hi, Thanks again for the answers. I''ve haven''t got to much time to play with puppet, but I always seems to forget that puppet compiles the code at the master, and sends this code to the nodes. The only thing that is transferred from the nodes regarding information, is facter information. Hence the variable ($ifconfig = generate("/usr/sbin/ ifconfig", "eth0") will be equal on all nodes when they get the compiled configuration. The only simple way I can think of is creating a manifest which uses curl to POST a file to a HTTP server (or some other protocol). It can be quite time consuming to compare 30 httpd.conf just to verify that they are equal (they should be, but you never know without checking it) before managing them with puppet. Thanks for your help /Tore On 7 apr, 16:36, Daniel Pittman <dan...@rimspace.net> wrote:> Tore <tore.lo...@gmail.com> writes: > > What options does puppet provide to transfer information back to > > puppetmaster? > > Facter, as was already pointed out, and the option of exported and imported > resources if you have storeconfig enabled. However... > > [...] > > > I have a few cases where just retrieving file X from all nodes would > > be excellent, e.g. httpd.conf, just to diff them locally to verify > > that no differences is present, before adding a manifest for handling > > that file. > > > Does puppet have anything in stock for me here? > > ...this is not something that puppet is really designed to do, as far as I am > aware. So, it doesn''t really offer many tools to support this sort of > discovery. > > I tend to use ''noop'' on the specific resource and ''puppetd --test'' on the > servers, or to use our ad-hoc change tools to fetch the appropriate files back > to my central system for me. > > Daniel > -- > ✣ Daniel Pittman ✉ dan...@rimspace.net ☎ +61 401 155 707 > ♽ made with 100 percent post-consumer electrons-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Daniel Pittman
2010-Apr-09 03:52 UTC
Re: [Puppet Users] Re: Possible options to transfer information from nodes to master?
Tore <tore.lonoy@gmail.com> writes:> Thanks again for the answers. I''ve haven''t got to much time to play with > puppet, but I always seems to forget that puppet compiles the code at the > master, and sends this code to the nodes. The only thing that is transferred > from the nodes regarding information, is facter information. Hence the > variable ($ifconfig = generate("/usr/sbin/ ifconfig", "eth0") will be equal > on all nodes when they get the compiled configuration.Yes, it would, because it would run ifconfig on master on each node.> The only simple way I can think of is creating a manifest which uses curl to > POST a file to a HTTP server (or some other protocol). It can be quite time > consuming to compare 30 httpd.conf just to verify that they are equal (they > should be, but you never know without checking it) before managing them with > puppet.*nod* For what it is worth, I would suggest that you set up a suite of ad-hoc change tools to work alongside puppet (or, in fact, alongside any tool that works like puppet.) For those ad-hoc tools the ability to run a shell command, as an arbitrary user, and to transfer files to and from the systems is invaluable. It is also ideal if you can easily say "only these systems" to the tool. Then you can use that to drag down the httpd.conf on all the machines, or sha1sum them and find what is identical, or... You don''t want to use ad-hoc change tools often, but when you need them they are invaluable. This is *especially* true when you have a one-shot job like "compare these files before we take ''em over" to do. Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.