Ask Your Question
2

How do I write a module with Puppet for windows .lnk shortcuts

asked 2013-01-31 15:33:37 -0500

tracyfan_1 gravatar image

I am using puppet to manage a few windows hosts on a very small network just to get it going and really understand it and would like to know how I can edit the target field in a .lnk shortcut file to point to a new target with certain parameters?

I know where the shortcut files are I am just not sure how I can edit the target fields in the .lnk shortcuts properties using a module. If anyone can help it would be much appreciated.

Thanks

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
5

answered 2013-02-13 23:20:41 -0500

stahnma gravatar image
edit flag offensive delete link more

Comments

The example in this module is somewhat of a misnomer. It does not create literal Windows shortcuts, it actually creates an Internet Explorer Favorite file, which is a simple text ...(more)

alindstrom gravatar imagealindstrom ( 2014-03-03 14:08:26 -0500 )edit
2

answered 2013-01-31 17:22:59 -0500

czervik gravatar image

updated 2013-01-31 17:26:33 -0500

Puppet can't natively manage windows lnk files. This may not be flexible enough for your needs, but I just bundle the needed variations of shortcuts in Puppet and use facts to load the right shortcut. For example,

  $shortcut_source = $::os_architecture ? {
   '64'  => 'shortcut64.lnk',
   '32'  => 'shortcut32.lnk',
  }

file { 'shortcut':
  path    => 'C:/shortcut.lnk',
  ensure  => present,
  source  => "puppet:///modules/example/${shortcut_source}",
}

You could also write a custom type/provider that programmatically manages shortcuts. This might be a good place to start: http://rubyforge.org/docman/view.php/85/1722/Shortcut.html

Not sure if there is a pending feature request to add ... (more)

edit flag offensive delete link more
1

answered 2013-02-07 14:39:32 -0500

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-01-31 15:33:37 -0500

Seen: 865 times

Last updated: Feb 13 '13