jhoblitt
06/17/2022, 9:12 PMjhoblitt
06/17/2022, 9:20 PMtvaughan
06/17/2022, 9:25 PMtype/file/target.rb
jhoblitt
06/17/2022, 9:27 PMrelace?
. duh.natemccurdy
06/17/2022, 9:27 PMensure => link
calls the mklink
method.
• https://github.com/puppetlabs/puppet/blob/7.17.0/lib/puppet/type/file/ensure.rb#L104
mklink
then just replaces the link and doesn’t look for replace
at all:
• https://github.com/puppetlabs/puppet/blob/7.17.0/lib/puppet/type/file/target.rb#L34-L61natemccurdy
06/17/2022, 9:27 PMensure => link
calls the mklink
method.
• https://github.com/puppetlabs/puppet/blob/7.17.0/lib/puppet/type/file/ensure.rb#L104
mklink
then just replaces the link and doesn’t look for replace
at all:
• https://github.com/puppetlabs/puppet/blob/7.17.0/lib/puppet/type/file/target.rb#L34-L61tvaughan
06/17/2022, 9:28 PMtvaughan
06/17/2022, 9:28 PMjhoblitt
06/17/2022, 9:29 PMfile { '/foo/foo':
ensure => link,
replace => false,
target => 'bar',
}
jhoblitt
06/17/2022, 9:29 PMln -snf baz /foo/foo
jhoblitt
06/17/2022, 9:29 PMln -snf baz /foo/foo
tvaughan
06/17/2022, 9:29 PMtvaughan
06/17/2022, 9:29 PMnatemccurdy
06/17/2022, 9:30 PMbut whose content doesn’t match what theWhich implies the docs were written with the assumption that you’re replacing a symlink with a file (orsource
attributecontent
ensure => file
) that has contents.natemccurdy
06/17/2022, 9:31 PMtvaughan
06/17/2022, 9:31 PMtvaughan
06/17/2022, 9:32 PMjhoblitt
06/17/2022, 9:32 PMnatemccurdy
06/17/2022, 9:32 PMjhoblitt
06/17/2022, 9:32 PMtvaughan
06/17/2022, 9:32 PMnatemccurdy
06/17/2022, 9:33 PMjhoblitt
06/17/2022, 9:34 PMjhoblitt
06/17/2022, 9:34 PMnatemccurdy
06/17/2022, 9:34 PMnatemccurdy
06/17/2022, 9:34 PMtvaughan
06/17/2022, 9:34 PMjhoblitt
06/17/2022, 9:35 PMjhoblitt
06/17/2022, 9:36 PMjhoblitt
06/17/2022, 9:36 PM