generate a link
This commit is contained in:
parent
1b4f833b19
commit
72dcd72362
1 changed files with 20 additions and 0 deletions
20
manifests/defines/link.pp
Normal file
20
manifests/defines/link.pp
Normal file
|
@ -0,0 +1,20 @@
|
|||
# common/manifests/defines/link.pp -- create a link
|
||||
#
|
||||
# Copyleft (C) 2009 immerdaadmin <admin@immerda.ch>
|
||||
# See LICENSE for the full license granted to you.
|
||||
|
||||
# Usage:
|
||||
# link { "/usr/bin/convert": target => "/usr/local/bin/convert" }
|
||||
# e.g. equivalent to bash# ln -s /usr/bin/convert /usr/local/bin/convert
|
||||
|
||||
define link(
|
||||
$target = 'absent'
|
||||
) {
|
||||
if ($target != 'absent') {
|
||||
file { "$name":
|
||||
ensure => link,
|
||||
target => "${target}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in a new issue