[Puppet Users] Re: Conditional based on existence of a file

2009-10-29 Thread Peter Meier
>> 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 "i

[Puppet Users] Re: Conditional based on existence of a file

2009-10-29 Thread Michael Gliwinski
On Thursday 29 October 2009 05:00:34 John Philips wrote: > Perhaps I just need to approach it a different way: create a new type and > put all my custom logic in there? I think this may indeed be the direction you could explore. The manifests are compiled into resources and their parameters on

[Puppet Users] Re: Conditional based on existence of a file

2009-10-29 Thread David Schmitt
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 = clien

[Puppet Users] Re: Conditional based on existence of a file

2009-10-28 Thread John Philips
> well imho what is talked about in this thread is an onlyif > parameter for > a resource, so unless/onlyif as a metaparameter. Right? > > BUT this won't be something like: > > if File.exist?('/foo/bar') { >   package{'foobar': ensure => present } > } > > this will be like: > > package{'foobar

[Puppet Users] Re: Conditional based on existence of a file

2009-10-28 Thread Peter Meier
Hi >>> If it's so easy, please provide an example >> solution. And if your >>> example consists of disparate facts to determine if >> specific files >>> exist, please don't bother because that's specifically >> what I said I >>> wasn't looking for :-) >> simply use puppet as a standalone tool, t

[Puppet Users] Re: Conditional based on existence of a file

2009-10-28 Thread John Philips
> > If it's so easy, please provide an example > solution.  And if your  > > example consists of disparate facts to determine if > specific files  > > exist, please don't bother because that's specifically > what I said I  > > wasn't looking for :-) > > simply use puppet as a standalone tool,

[Puppet Users] Re: Conditional based on existence of a file

2009-10-27 Thread Peter Meier
> I can't speak to the original poster's goal, but actually implementing > something that lets me declare what the current state is, really does > require testing what the current state is. Which, presumably, is why the > exec type already supports "onlyif" and "unless". Extending those to > other

[Puppet Users] Re: Conditional based on existence of a file

2009-10-27 Thread Peter Meier
> I don't want to get deeply into the middle of this (and so will > leave my contribution to just this e-mail), but there is > a small point I want to make, that I think Peter touched on, but may > not have gotten across. > > Puppet manifests are declarative, not executable. > > The manifests

[Puppet Users] Re: Conditional based on existence of a file

2009-10-27 Thread Peter Meier
Hi > Hi Peter, perhaps you started writing your response before reading > my entire message. I suggested a possible solution - behavior > similar to the 'onlyif' option of the exec Type. Look at the docs, > exec only runs the command on the client if the 'onlyif' command, > which also r

[Puppet Users] Re: Conditional based on existence of a file

2009-10-26 Thread seph
> Puppet manifests are declarative, not executable. This comes up frequently, and seems quite frustrating. People ask questions, and often are told their questions are wrong, because puppet is declarative. While it's sometimes correct, sometimes it's wrong. I'm pretty far from an expert, but I kn

[Puppet Users] Re: Conditional based on existence of a file

2009-10-26 Thread Craig Miskell
> Anyway, it appears that what I'm looking for may not be possible today > without custom facts. Ok, fine. >My next question is, why? If it's because such functionality just hasn't >been added yet, >that's perfectly reasonable. I'll be glad to submit a more detailed and >descriptive fe

[Puppet Users] Re: Conditional based on existence of a file

2009-10-26 Thread John Philips
> > The mailing lists contain > several postings to the > > effect of 'custom facts work, just write your own and > be quiet', > > which frustrates me.  > > the main issue behind that is that all the functions are > evaluated on > the server and only there. Hi Peter, perhaps you started writing

[Puppet Users] Re: Conditional based on existence of a file

2009-10-26 Thread Peter Meier
Hi > [...] > > It suggests creating a custom fact which indicates if the file exists > on the client or not. Well, frankly I don't like that idea, for two > reasons. > > 1. I'd have to create a custom fact for every check, which would > become cumbersome/tedious and is (IMHO) is just a hack/w