(#14531) Change default ensure value from symlink to link
If ensure on a file resource is omitted, puppet will set the should value
to :symlink in the initialize method of the file type but the ensure property
does not use :symlink but :link to identify a link.
As a result, puppet will always treat a resource with a specific target
property but no ensure property as out of sync:
file { '/tmp/a': target => '/tmp/b', }
When puppet now calls sync on the ensure property, the fileresource
(/tmp/a) is removed first (method remove_existing) but we do not
execute the block passed to newvalue(:link) to recreate it. Because
there is no newvalue(:symlink) block, we instead run the block in
newvalue(/./) which is just a dummy and does nothing at all. As a
result puppet will *always* say it created something while in fact
making sure that the resource is *removed*.
Change the default ensure value from :symlink to :link if target is
set.