1

It's documented that Puppet will auto-require certain resources, e.g. a (puppet-managed) directory that is a parent of a File resource, or a group resource referenced in a user resource.

If an auto-required resource has been declared as a virtual resource, is it necessary to explicitly realize that resource, or will the auto-require cause it to happen implicitly?

Alnitak
  • 21,191
  • 3
  • 52
  • 82

1 Answers1

1

It seems that the answer is that virtual resources are not automatically realized if they're auto-required. The following manifest will result in a "No such file or directory" error:`

@file { '/foo':
  ensure => directory
}

file { '/foo/test':
  content => 'this is a test file'
}

but works fine if the virtual resource is explicitly realized with:

realize File['/foo']
Alnitak
  • 21,191
  • 3
  • 52
  • 82