Mea culpa for a misleading information. Thanks John for the explanation, I didn't know about the 'particular instant during the catalog compilation'. And for the ensure => absent, I haven't thought about that one.
-- Yanis Guenane On 08/20/2014 09:11 AM, jcbollinger wrote: > > > On Tuesday, August 19, 2014 11:10:26 AM UTC-5, Yanis Guenane > wrote: >> >> If your file `/volumes/vol1` could be managed by Puppet somehow, >> you could use if defined(File['/volumes/vol1']) as a condition. >> >> Not sure if it is possible in your case, >> > > > Whether it's possible is irrelevant, because that's not *correct* > in any case. That use of the defined() function tests whether > File['/volumes/vol1'] is in the catalog -- and even then it tests > only at a particular instant during catalog compilation, ignoring > any later addition of such a resource to the catalog. AND it will > return true if File['/volumes/vol1'] has ensure => absent. None of > that has anything to do with whether said file/directory is > actually present on the target system at the start of the run, or > at any random point in the middle of a run. > > Do not use defined(). Ever. > > > John > -- 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/53F4C0B5.2010908%40gmail.com. For more options, visit https://groups.google.com/d/optout.
