0
file {'VaultUsersLink':
      path => "C:/VaultWorkspace/VaultUsers.lnk",
      require => File['VaultWorkspace'],
      ensure => link,
      target => "C:/ProgramData/PuppetLabs/facter/facts.d/inventorusers.txt",
      owner => 'SYSTEM',
      group => 'Users',
      mode => 0776,
      }

Seems like it should make a shortcut, and it does make a 0 byte file named VaultUsers.lnk, but doesn't fill in the target. Am I missing something?

0
1

A link is not a Windows shortcut. A link is symbolic link. http://en.wikipedia.org/wiki/Symbolic_link. Does the file inventorusers.txt also have zero bytes?

link will make sure the file is a symlink, and requires that you also set the target attribute. Symlinks are supported on all Posix systems and on Windows Vista / 2008 and higher. On Windows, managing symlinks requires puppet agent’s user account to have the “Create Symbolic Links” privilege; this can be configured in the “User Rights Assignment” section in the Windows policy editor. By default, puppet agent runs as the Administrator account, which does have this privilege.

2
  • Ummm, did you read your link?:[...]a symbolic link (also symlink or soft link) is a special type of file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution.[...]Today they are supported by the POSIX operating-system standard, [...] and also Windows operating systems such as Windows Vista, Windows 7 and to some degree in Windows 2000 and Windows XP in the form of Shortcut files. – jmp242 Mar 18 '14 at 19:59
  • Yes I am well aware of what that page says, the important part is the 'to some degree'. Shortcuts are not symbolic links, they only act like them to some degree. They are stored differently on the filesystem. Their similaries doesn't really doesn't matter, because the 'link' type within puppet refers to NTFS windows symbolic links only. The windows file provider does not create shortcuts files (.lnk files). – Zoredache Mar 18 '14 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.