On Mon, Aug 18, 2014 at 10:01 AM, Christopher Wood <
[email protected]> wrote:

> This is generally the reason that you need something like puppet, that you
> want to enforce a configuration.
>
> If you need to detect things about a server, there are a number of things
> you can do:
>
> a) monitoring (snmp?) check invoking a custom script, script detects the
> dir
> b) use something like mcollective to check in real time whether the dir
> exists
> c) ssh in and use ls
>

d) Write a custom fact; external facts
<https://docs.puppetlabs.com/facter/latest/custom_facts.html#external-facts>
make it as easy as writing a small shell script:

/etc/facter/facts.d/mydir.sh:
#!/bin/sh
test -d /foo/bar && echo "dir_foo_bar_exists=true"


> The usual point also, that you should stop asking your servers how they
> are and tell them how they should be. Declare, don't inquire.


That's great advice and a worthwhile long-term goal. But when you're just
starting out or are increasing management coverage incrementally, you need
to do these kinds of things.

Wil

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAMmm3r7XFyhLHy2ocT1JSydYuY1GvJW9H_4XgJVQCKwptWeWEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to