| In Puppet 4.x one could use a resource collector to override parameters of a file resource, but this is no longer working in 5.x. The failure occurs when there is a resource default in the manifest with the virtual resource and a collector override that specifies the same value. Below are example manifests that cause the failure.
# cat manifests/init.pp |
class test { |
File { |
ensure => directory, |
owner => '0', |
group => '0', |
mode => '0755', |
} |
|
@file { '/tmp/testing': |
owner => '0', |
group => '0', |
mode => '0750', |
} |
} |
# cat manifests/realize.pp |
class test::realize { |
require test |
File <| title == '/tmp/testing' |> { mode => '0755' } |
} |
The result of the example above is that the mode of the file is `0750` instead of the expected `0755`.
drwxr-x--- 2 root root 68 May 16 13:57 /tmp/testing |
When there is no default file resource in the example above, the override works correctly:
# cat manifests/init.pp |
class test { |
|
@file { '/tmp/testing': |
ensure => directory, |
owner => '0', |
group => '0', |
mode => '0750', |
} |
} |
# cat manifests/realize.pp |
class test::realize { |
require test |
File <| title == '/tmp/testing' |> { mode => '0755' } |
} |
The result is a file with `0755` permissions.
drwxr-xr-x 2 root root 68 May 16 13:59 /tmp/testing |
This behavior was not seen with Puppet 4.x, so it appears to be a regression in 5.x. |