Mohamed Lrhazi
2011-Jan-13 16:15 UTC
[Puppet Users] Include module only if exists (per hostname modules)
Sorry if this is RTFM... I added code like so to my config: [master] templatedir = /etc/puppet/environments/$environment/ modulepath /etc/puppet/environments/$environment/modules:/etc/puppet/environments/$environment/modules/per_host manifest = /etc/puppet/environments/$environment/manifests/site.pp manifestdir = /etc/puppet/environments/$environment/manifests and under the per_host dir I created a module m_akubra. In my nodes.pp, I added: include "m_$hostname" Now host akubra gets its module fine, but other hosts log an error about their module not being found. Is there a way to avoid the errors? Thanks a lot. Mohamed. -- 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
2011-Jan-13 17:35 UTC
Re: [Puppet Users] Include module only if exists (per hostname modules)
On Jan 13, 2011 8:16 AM, "Mohamed Lrhazi" <lrhazi@gmail.com> wrote:> > Sorry if this is RTFM... > I added code like so to my config:[…]> include "m_$hostname" > > Now host akubra gets its module fine, but other hosts log an error > about their module not being found. > > Is there a way to avoid the errors?Puppet doesn''t support that, no. If you specify a class you need to define it. Generally you would use the node definition itself to contain the per-host settings like that. Regards, Daniel -- 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.