|
If you create a file resource with recurse => remote for a subdirectory of a directory that is also managed by a file resource with recurse => remote, the top level directory will be silently left unmanaged.
To recreate:
# cat recurse/manifests/init.pp
|
class recurse {
|
file { "/tmp/level1":
|
ensure => directory,
|
source => 'puppet:///modules/recurse/level1',
|
recurse => 'remote',
|
}
|
|
file { "/tmp/level1/level2":
|
ensure => directory,
|
source => 'puppet:///modules/recurse/optional',
|
recurse => 'remote',
|
}
|
}
|
# tree recurse/files/
|
recurse/files/
|
├── level1
|
│ └── level2
|
│ ├── file1
|
│ └── file2
|
└── optional
|
├── file3
|
└── file4
|
|
3 directories, 4 files
|
The expected behavior is that the first file resource will create /tmp/level1/level2 with the file1 and file2 and the second resource will tack on file3 and file4. The actual results are:
# puppet apply -e "include recurse"
|
Notice: Compiled catalog for pe-201620-master.puppetdebug.vlan in environment production in 0.05 seconds
|
Notice: /Stage[main]/Recurse/File[/tmp/level1]/ensure: created
|
Notice: /Stage[main]/Recurse/File[/tmp/level1/level2]/ensure: created
|
Notice: /Stage[main]/Recurse/File[/tmp/level1/level2/file3]/ensure: defined content as '{md5}d41d8cd98f00b204e9800998ecf8427e'
|
Notice: /Stage[main]/Recurse/File[/tmp/level1/level2/file4]/ensure: defined content as '{md5}d41d8cd98f00b204e9800998ecf8427e'
|
Notice: Applied catalog in 0.30 seconds
|
The files from the second file resource (file3 and file4) are pulled in, and the ones in the original resource are silently left out. This manifest should either handle the nested resources and pull all files or generate an error regarding nested file resources.
|