Thanks for clearing it up. I ended up just using onlyif and unless in each exec statement. this allowed me to rcycle the same commands between the scenario of creating the volume and mounting and encrypting the volume and mounting it.
Thanks On Wednesday, August 20, 2014 6:11:14 AM UTC-7, 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 puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/9abcda62-bcc5-44b8-9b24-710afa056fdd%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.