generate a link
authorAndreas <andreas@immerda.ch>
Wed, 18 Nov 2009 15:53:57 +0000 (16:53 +0100)
committerMicah Anderson <micah@riseup.net>
Thu, 2 Sep 2010 22:13:49 +0000 (18:13 -0400)
manifests/defines/link.pp [new file with mode: 0644]

diff --git a/manifests/defines/link.pp b/manifests/defines/link.pp
new file mode 100644 (file)
index 0000000..3325e4b
--- /dev/null
@@ -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}"
+      }
+    }
+}
+