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 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. On Mon, Aug 18, 2014 at 05:05:43AM -0700, Satish Katuru wrote: > Hi , > > I wanted to find out whether the directory exists or not in the > machine.How can I do it? > > if I do it as below it will create a directory: > > File { " /etc/puppet/test": > ensure => "directory", > > } > > -- > 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 [1]puppet-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > > [2]https://groups.google.com/d/msgid/puppet-users/6f8d03fb-8d97-4832-a3b7-70868132c451%40googlegroups.com. > For more options, visit [3]https://groups.google.com/d/optout. > > References > > Visible links > 1. mailto:puppet-users+unsubscr...@googlegroups.com > 2. > https://groups.google.com/d/msgid/puppet-users/6f8d03fb-8d97-4832-a3b7-70868132c451%40googlegroups.com?utm_medium=email&utm_source=footer > 3. https://groups.google.com/d/optout -- 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 puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/20140818170118.GA906%40iniquitous.heresiarch.ca. For more options, visit https://groups.google.com/d/optout.