Hey William,

Welcome to Puppet.

On Mon, Oct 12, 2009 at 2:01 AM, william Famy <william.f...@gmail.com> wrote:
> Hi.
>
> II am trying puppet after cfengine and I am looking for a method to use a
> class if a file exist.

One way to express this is to write a custom fact to test whether or
not a file is on the client system.  Shouldn't be hard to follow the
custom fact documentation.

http://reductivelabs.com/trac/puppet/wiki/AddingFacts

Then you can simply wrap a conditional around the fact you create.

if $yourfact {
  include yourclass
}

>
> exemple
>
> I have a condition class.
> I have to create on the server the condition class but i do not want to have
> it execute on every client. It is not easy for me to set on the server the
> condition to execute the class.
>
> I prefer runing class on my client if thereis a file exemple if the file
> /etc/mypuppet/condition is present execute the condition class.
>
> Is it possible?
> How can i do it?

So you can use the pattern above, but I bet there is a better way to
model you configuration.  What is you use case?  Ignore Puppet and
CFengine for a moment and describe the problem.  Often times there are
simpler more maintainable patterns of expression that will yield the
same configuration.

>
>
> thanks for your help.
>
> regards
>
> >
>

Cheers,
Teyo



-- 
Teyo Tyree :: www.reductivelabs.com :: +1.615.275.5066

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to