John Philips wrote:
> But now I'm confused again...
> 
> You say that this is possible and may even be implemented soon:
> 
> package { 'foobar':
>   ensure => installed,
>   onlyif => 'test -f /foo/bar',
> }
> 
> But something like this is pretty much out-of-the-question?
> 
> $foo_exists = client_exec('test -f /foo/bar')
> if $foo_exists == 0 {
>     # file exists, load the module
>     include foobar
> }
> 
> Both scenarios involve a decision based on output from the client.

Based on output from client, but in totally different ways. When the 
client requests a configuration, it sends all known facts to the server. 
The server then computes the list of resources (evaluating functions 
like "include") and sends that back to the client. This is a very 
efficient one-roundtrip request to the server.

Having something like your "client_exec" would require many additional 
roundtrips from the server to the client. Besides the fundamental 
ugliness of such an approach, in many environments server->client 
connections are forbidden.



If you still, really, really, really want to implement this today, you 
could create an external node classifier[1], which queries the client 
and creates the proper list of classes. It still incurs the overhead and 
the communications issue, but you isolate your complexity in one 
well-defined place.



Regards, DavidS


[1]http://reductivelabs.com/trac/puppet/wiki/ExternalNodes

--~--~---------~--~----~------------~-------~--~----~
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