daniel g
2009-Jul-06 23:28 UTC
[Puppet Users] pluginsync syncing all custom facts in every module
It appears that pluginsync is syncing every custom fact in all modules in our puppetmasterd''s modulepath, regardless of whether or not the modules are included for the node in the node list. Is there any way to ensure that only facts from modules that the client is including are synced, or is this the intended behavior and we should structure our custom facts/functions with this in mind? I''ve double checked the documentation and am not seeing anything specifically relevant. puppetmaster/puppetd @ 0.24.8, facter 1.5.5, ruby 1.8.5 Thanks, --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Nicolas Szalay
2009-Jul-07 06:43 UTC
[Puppet Users] Re: pluginsync syncing all custom facts in every module
Le lundi 06 juillet 2009 à 16:28 -0700, daniel g a écrit :> It appears that pluginsync is syncing every custom fact in all modules > in our puppetmasterd''s modulepath, regardless of whether or not the > modules are included for the node in the node list. > > > > Is there any way to ensure that only facts from modules that the > client is including are synced, or is this the intended behavior and > we should structure our custom facts/functions with this in mind?I don''t know if it is possible to sync only a part of facts but you can make your facts OS specific with confine : Facter.add("myfact") do confine :operatingsystem => :openbsd # blah end Please note that it could be something else than the "operatingsystem" value reported by facter. Regards, Nico.
David Schmitt
2009-Jul-07 10:52 UTC
[Puppet Users] Re: pluginsync syncing all custom facts in every module
daniel g wrote:> It appears that pluginsync is syncing every custom fact in all modules > in our puppetmasterd''s modulepath, regardless of whether or not the > modules are included for the node in the node list. > > Is there any way to ensure that only facts from modules that the client > is including are synced, or is this the intended behavior and we should > structure our custom facts/functions with this in mind? > > I''ve double checked the documentation and am not seeing anything > specifically relevant.pluginsyncing happens before the configuration for a client is compiled. Therefore it is fundamentally not possible to avoid distribution of code via pluginsync. If you really need more finegrained control, either use facter''s confine mechanism, like Nicolas suggested, or distribute your code via file{}. Be aware though, that the latter will cause puppet runs which do not have the code/facts/custom types available and need to be guarded properly. Regards, DavidS --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ohad Levy
2009-Jul-07 12:56 UTC
[Puppet Users] Re: pluginsync syncing all custom facts in every module
you are right, at the current stage it doesn''t scale well, a more realistic scenario for me is that i have multiple version of the same fact in different environments. the solution that I can is to use factsync on the normal clients, and to use pluginsync on my puppetmasters. than in the puppetmaster manifest i distribute the facts, functions etc - not perfect, but acceptable for now. my 2 cents, Ohad On Tue, Jul 7, 2009 at 7:28 AM, daniel g <daniel@invisiblempire.com> wrote:> It appears that pluginsync is syncing every custom fact in all modules in > our puppetmasterd''s modulepath, regardless of whether or not the modules are > included for the node in the node list. > > Is there any way to ensure that only facts from modules that the client is > including are synced, or is this the intended behavior and we should > structure our custom facts/functions with this in mind? > > I''ve double checked the documentation and am not seeing anything > specifically relevant. > > puppetmaster/puppetd @ 0.24.8, facter 1.5.5, ruby 1.8.5 > > Thanks, > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Joshua Barratt
2009-Jul-07 14:17 UTC
[Puppet Users] Re: pluginsync syncing all custom facts in every module
On Mon, Jul 6, 2009 at 4:28 PM, daniel g <daniel@invisiblempire.com> wrote:> It appears that pluginsync is syncing every custom fact in all modules in > our puppetmasterd''s modulepath, regardless of whether or not the modules are > included for the node in the node list. >It actually HAS to work this way, since module inclusion could be (and often is) determined by values of other facts. Let''s say you have node foo { include pony } which defines a custom fact ''i_has_a_pony''. class pony { if($i_has_a_pony) { include saddle } } if the ''saddle'' module has custom facts of it''s own, you''d need to have those values available at that exact moment -- you can''t do another pass of gathering facts. So therefore ANY custom facts for ALL module must ALWAYS be generated, hence the need to use '':confine'' when that''s not possible. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---