Dan White
2012-Aug-06 15:48 UTC
[Puppet Users] A few questions about setting up Custom Facts
I am putting together some system improvements based on using the stdlib::facter-dot-d and I have a few questions: Are facts always single “key => value” pairs or can you get a hash or array into a fact ? I suspect arrayed/hashed facts are not possible in the current environment, but I feel it does not hurt to ask. “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) -- 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.
jcbollinger
2012-Aug-07 14:05 UTC
[Puppet Users] Re: A few questions about setting up Custom Facts
On Monday, August 6, 2012 10:48:25 AM UTC-5, Ygor wrote:> > I am putting together some system improvements based on using the > stdlib::facter-dot-d and I have a few questions: > > Are facts always single “key => value” pairs or can you get a hash or > array into a fact ? > > I suspect arrayed/hashed facts are not possible in the current > environment, but I feel it does not hurt to ask. >My understanding is that the protocol for sending facts from agent to master supports only string fact values. I think that''s the main restriction. John -- 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/-/haM_Y4GqlMkJ. 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.
Dan White
2012-Aug-07 19:26 UTC
Re: [Puppet Users] Re: A few questions about setting up Custom Facts
----- jcbollinger <John.Bollinger@stJude.org> wrote:> > > On Monday, August 6, 2012 10:48:25 AM UTC-5, Ygor wrote: > > > > I am putting together some system improvements based on using the > > stdlib::facter-dot-d and I have a few questions: > > > > Are facts always single “key => value” pairs or can you get a hash or > > array into a fact ? > > > > I suspect arrayed/hashed facts are not possible in the current > > environment, but I feel it does not hurt to ask. > > > > My understanding is that the protocol for sending facts from agent to > master supports only string fact values. I think that''s the main > restriction. > > > JohnSo, then could I do the following ? test.yaml: stack_info: one,two,three,four,five “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) -- 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.
jcbollinger
2012-Aug-08 13:06 UTC
Re: [Puppet Users] Re: A few questions about setting up Custom Facts
On Tuesday, August 7, 2012 2:26:47 PM UTC-5, Ygor wrote:> > ----- jcbollinger wrote: > > > > > > On Monday, August 6, 2012 10:48:25 AM UTC-5, Ygor wrote: > > > > > > I am putting together some system improvements based on using the > > > stdlib::facter-dot-d and I have a few questions: > > > > > > Are facts always single “key => value” pairs or can you get a hash or > > > array into a fact ? > > > > > > I suspect arrayed/hashed facts are not possible in the current > > > environment, but I feel it does not hurt to ask. > > > > > > > My understanding is that the protocol for sending facts from agent to > > master supports only string fact values. I think that''s the main > > restriction. > > > > > > John > > So, then could I do the following ? > > test.yaml: > stack_info: one,two,three,four,five > >Um, yes? I mean, it''s not clear what, if anything, you intend for that to do. If you''re asking whether you can send delimited strings as fact values, then of course you can. And once it reaches the master, Puppet has a built-in split() function that can turn such a delimited string into the corresponding array. John -- 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/-/f03YLTHK-5IJ. 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.
Dan White
2012-Aug-08 13:28 UTC
Re: [Puppet Users] Re: A few questions about setting up Custom Facts
----- jcbollinger <John.Bollinger@stJude.org> wrote:> On Tuesday, August 7, 2012 2:26:47 PM UTC-5, Ygor wrote: > > > > ----- jcbollinger wrote: > > > On Monday, August 6, 2012 10:48:25 AM UTC-5, Ygor wrote: > > > > > > > > I am putting together some system improvements based on using the > > > > stdlib::facter-dot-d and I have a few questions: > > > > > > > > Are facts always single “key => value” pairs or can you get a hash or > > > > array into a fact ? > > > > > > > > I suspect arrayed/hashed facts are not possible in the current > > > > environment, but I feel it does not hurt to ask. > > > > > > > > > > My understanding is that the protocol for sending facts from agent to > > > master supports only string fact values. I think that''s the main > > > restriction. > > > > > > > > > John > > > > So, then could I do the following ? > > > > test.yaml: > > stack_info: one,two,three,four,five > > > > > Um, yes? > > I mean, it''s not clear what, if anything, you intend for that to do. If > you''re asking whether you can send delimited strings as fact values, then > of course you can. And once it reaches the master, Puppet has a built-in > split() function that can turn such a delimited string into the > corresponding array. > > > JohnI want to use puppetlabs-stdlib and /etc/facter/facts.d to create a set of local facts. Some of these facts come in variable quantities. I would like to stack these up into a delimited string. I can deal with that. On thing about your responses that puzzles me is the repeated mention of facts going from the agent to the master. What is that about, please ? I am looking at facts local to the agent. My understanding is that all the "Magic Behind the Curtains" about puppet happens on the agent. What is the story here about agent facts on the master ? For what purpose ? “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) -- 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.
Tim Mooney
2012-Aug-08 18:08 UTC
Re: [Puppet Users] Re: A few questions about setting up Custom Facts
In regard to: Re: [Puppet Users] Re: A few questions about setting up...:> I want to use puppetlabs-stdlib and /etc/facter/facts.d to create a set > of local facts. Some of these facts come in variable quantities. I > would like to stack these up into a delimited string. I can deal with > that. > > On thing about your responses that puzzles me is the repeated mention of > facts going from the agent to the master. What is that about, please ? > I am looking at facts local to the agent. My understanding is that all > the "Magic Behind the Curtains" about puppet happens on the agent.That part is at least partially incorrect. Catalog compilation happens on the master. This means that the master has to know all the facts for each client, so that it can correctly build the catalog. The client gathers the facts and ships them to the master, so the master can build a catalog and ship the final result back to the client for application. Note also that this means that all functions run on the master too. See: http://docs.puppetlabs.com/learning/agent_master_basic.html though I''ve actually seen better diagrams of the communication, that''s the one I''m finding right now. Tim -- Tim Mooney Tim.Mooney@ndsu.edu Enterprise Computing & Infrastructure 701-231-1076 (Voice) Room 242-J6, IACC Building 701-231-8541 (Fax) North Dakota State University, Fargo, ND 58105-5164 -- 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.
Dan White
2012-Aug-08 18:52 UTC
Re: [Puppet Users] Re: A few questions about setting up Custom Facts
----- Tim Mooney <Tim.Mooney@ndsu.edu> wrote:> In regard to: Re: [Puppet Users] Re: A few questions about setting up...: > > > I want to use puppetlabs-stdlib and /etc/facter/facts.d to create a set > > of local facts. Some of these facts come in variable quantities. I > > would like to stack these up into a delimited string. I can deal with > > that. > > > > On thing about your responses that puzzles me is the repeated mention of > > facts going from the agent to the master. What is that about, please ? > > I am looking at facts local to the agent. My understanding is that all > > the "Magic Behind the Curtains" about puppet happens on the agent. > > That part is at least partially incorrect. > > Catalog compilation happens on the master. This means that the master > has to know all the facts for each client, so that it can correctly build > the catalog. The client gathers the facts and ships them to the master, > so the master can build a catalog and ship the final result back to the > client for application. > > Note also that this means that all functions run on the master too. > > See: > > http://docs.puppetlabs.com/learning/agent_master_basic.html > > though I''ve actually seen better diagrams of the communication, that''s > the one I''m finding right now. > > TimAh! Enlightenment ! Many thanks, Tim, for the clarification. It looks like I can still create custom facts using /etc/facter/facts.d that are, say, a comma delimited string of multiple values. Anything that wants to use these custom facts would be aware of this and would be built to handle it. Thanks to all on the list for en-clue-ing this relatively clueless one. While I am occasionally clueless, I strive never to seem clue-proof. “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) -- 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.