Hi,

In my organization there are several separate teams that manage their own 
applications.  For consistency's sake I want to 'puppetize' some aspects of the 
apps.

The problem is, I'm not the one who installs the apps and which apps exist on 
which servers is out of my control.  If a specific directory exists, I want 
puppet to do certain things, if it does not exist, I want puppet to ignore it.

In pseudo-code:

if file_exists("/opt/orange_app") {
    # file exists, load the module
    include orange
}

Now, I saw this thread from a while back:  
http://www.mail-archive.com/puppet-users@googlegroups.com/msg01329.html

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/workaround.
2.  The ability to determine whether a file exists via puppet would be a very 
useful and powerful feature that many, if not all puppeteers could make use of. 
 The mailing lists contain several postings to the effect of 'custom facts 
work, just write your own and be quiet', which frustrates me.  A wise manager 
once told me that you should build your systems around the needs of your 
business instead of building your business around the capabilities of your 
systems.

I searched the open issues and didn't find anything relating to such a feature. 
 I see from the puppet Type Reference that 'exec' has an optional 'onlyif' 
parameter, which is close to what I'm looking for.  But instead of the 'onlyif' 
applying to a single exec, I'd like it to to apply to an entire block of code 
in my puppet manifest.  For example, in pseudo-code:

$orange_exists = "test -e /opt/orange"

if $orange_exists.exitcode = 0 {
    # file exists, load the module
    include orange
}

Thanks.


      

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