Hi gents, i want to apply a class ,,perl'''' if there is a file /etc/fai-classes/ perl on the client. I guess the answer is obvious, but i don''t see it. If i could use shell syntax in my site.pp, i would do something like this: node schulung { [ -f /etc/fai-classes/perl ] && include perl } class perl { package { ["perl-doc","libterm-readline-perl-perl"]: ensure => installed, } } Any ideas? MFG, Karsten -- 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.
Nigel Kersten
2010-Dec-01 17:28 UTC
Re: [Puppet Users] apply class if a file on client exists
On Wed, Dec 1, 2010 at 8:32 AM, tecneeq <tecneeq@googlemail.com> wrote:> Hi gents, > > i want to apply a class ,,perl'''' if there is a file /etc/fai-classes/ > perl on the client. > > I guess the answer is obvious, but i don''t see it. If i could use > shell syntax in my site.pp, i would do something like this: > > node schulung { > [ -f /etc/fai-classes/perl ] && include perl > } > > class perl { > package { ["perl-doc","libterm-readline-perl-perl"]: > ensure => installed, > } > } > > Any ideas?Make a fact that reports whether or not the directory exists, and make the include of the class conditional on the fact value.> > MFG, > > Karsten > > -- > 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. > >-- Nigel Kersten - Puppet Labs - http://www.puppetlabs.com -- 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.
On 1 Dez., 18:28, Nigel Kersten <ni...@puppetlabs.com> wrote:> Make a fact that reports whether or not the directory exists, and make > the include of the class conditional on the fact value.Thanks, i did just that and it works. However, during testing it turned out that myfacts.rb isn''t sent to the remote puppetd after changing it''s content. I have to do this: puppetd -v --test --factsync Then, and only then, the fact generating file is synchronized. Any idea how to solve this one? MFG, Karsten -- 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.
Nigel Kersten
2010-Dec-03 18:18 UTC
Re: [Puppet Users] Re: apply class if a file on client exists
On Fri, Dec 3, 2010 at 8:28 AM, tecneeq <tecneeq@googlemail.com> wrote:> > > On 1 Dez., 18:28, Nigel Kersten <ni...@puppetlabs.com> wrote: > >> Make a fact that reports whether or not the directory exists, and make >> the include of the class conditional on the fact value. > > Thanks, i did just that and it works. > > However, during testing it turned out that myfacts.rb isn''t sent to > the remote puppetd after changing it''s content. I have to do this: > > puppetd -v --test --factsync > > Then, and only then, the fact generating file is synchronized. > > Any idea how to solve this one?You should be setting things up to work with pluginsync, not factsync. http://docs.puppetlabs.com/guides/plugins_in_modules.html> > MFG, > > Karsten > > -- > 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. > >-- Nigel Kersten - Puppet Labs - http://www.puppetlabs.com -- 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.