aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorAndreas <andreas@immerda.ch>2009-11-18 16:53:57 +0100
committerMicah Anderson <micah@riseup.net>2010-09-02 18:13:49 -0400
commit72dcd723629eba4b3ac4fd7d89303d4a110ad356 (patch)
tree155e81584770c3e3561da560c40fddd9d6a1852b /manifests
parent1b4f833b19f1036445dec143a0fd01b50ae16f29 (diff)
downloadpuppet-common-72dcd723629eba4b3ac4fd7d89303d4a110ad356.tar.gz
puppet-common-72dcd723629eba4b3ac4fd7d89303d4a110ad356.tar.bz2
generate a link
Diffstat (limited to 'manifests')
-rw-r--r--manifests/defines/link.pp20
1 files changed, 20 insertions, 0 deletions
diff --git a/manifests/defines/link.pp b/manifests/defines/link.pp
new file mode 100644
index 0000000..3325e4b
--- /dev/null
+++ b/manifests/defines/link.pp
@@ -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}"
+ }
+ }
+}
+