Ask Your Question

Revision history [back]

You can use file resources without specifying any source or content attribute:

file {
  default:
    owner   => 'newuser',
    group   => 'newgroup',
    require => Package['my_package'],
  ;
  ['/directory0/directory1/', '/directory0/directory2/']:
    ensure  => directory,
  ;
  ['/directory2/directory3/file', '/directory2/directory3/name.bsh']:
    ensure  =>  present,
  ;
}

The construct with default is known as per-expression default attributes. You obviously want to set require => Package['foo'] since Puppet itself does not create the files, but your package (resource) does.

You can use file resources without specifying any source or content attribute:

file {
  default:
    owner   => 'newuser',
    group   => 'newgroup',
    require => Package['my_package'],
  ;
  ['/directory0/directory1/', '/directory0/directory2/']:
    ensure  => directory,
  ;
  ['/directory2/directory3/file', '/directory2/directory3/name.bsh']:
    ensure  =>  present,
  ;
}

The construct with default is known as per-expression default attributes. You obviously want to set require => Package['foo'] since Puppet itself does not create the files, but your package (resource) does.