dev/provisioning/modules/puppi/manifests/run.pp
changeset 28 b0b56e0f8c7f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dev/provisioning/modules/puppi/manifests/run.pp	Fri Jan 15 15:35:00 2016 +0100
@@ -0,0 +1,31 @@
+# Define puppi::run
+#
+# This define triggers a puppi deploy run directly during Puppet
+# execution. It can be used to automate FIRST TIME applications
+# deployments directly during the first Puppet execution
+#
+# == Variables
+#
+# [*name*]
+#   The title/name you use has to be the name of an existing puppi::project
+#   procedure define
+#
+# == Usage
+# Basic Usage:
+# puppi::run { "myapp": }
+#
+define puppi::run (
+  $project = '',
+  $timeout = 300) {
+
+  require puppi
+
+  exec { "Run_Puppi_${name}":
+    command => "puppi deploy ${name}; [ $? -le \"1\" ] && touch ${puppi::params::archivedir}/puppirun_${name}",
+    path    => '/bin:/sbin:/usr/sbin:/usr/bin',
+    creates => "${puppi::params::archivedir}/puppirun_${name}",
+    timeout => $timeout,
+    # require => File[ tag == 'puppi_deploy' ],
+  }
+
+}