That might work if you were compiling the catalog on the server where the catalog will be applied. Functions/templates are run during catalog compilation so this will not find a directory on a pure-agent node.
https://docs.puppetlabs.com/learning/templates.html https://docs.puppetlabs.com/guides/templating.html On Wed, Aug 20, 2014 at 04:21:12PM -0700, Jason_s wrote: > you could drop down into pure ruby and evaluate that inside > an inline_template⦠> On Monday, August 18, 2014 2:05:43 PM UTC+2, 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][email protected]. > To view this discussion on the web visit > > [2]https://groups.google.com/d/msgid/puppet-users/dc11f203-f961-4fb0-8004-be7ed51b02a6%40googlegroups.com. > For more options, visit [3]https://groups.google.com/d/optout. > > References > > Visible links > 1. mailto:[email protected] > 2. > https://groups.google.com/d/msgid/puppet-users/dc11f203-f961-4fb0-8004-be7ed51b02a6%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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/20140821030152.GA24061%40iniquitous.heresiarch.ca. For more options, visit https://groups.google.com/d/optout.
