diff -r a2342f26c9de -r b0b56e0f8c7f dev/provisioning/modules/puppi/manifests/deploy.pp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev/provisioning/modules/puppi/manifests/deploy.pp Fri Jan 15 15:35:00 2016 +0100 @@ -0,0 +1,40 @@ +# Define puppi::deploy +# +# This define creates a file with a deploy command that can be used locally. +# +# == Usage: +# puppi::deploy { "Retrieve files": +# command => "get_file.sh", +# argument => "/remote/dir/file", +# priority => "10", +# user => "root", +# project => "spysite", +# } +# +# :include:../README.deploy +# +define puppi::deploy ( + $command, + $project, + $arguments = '', + $priority = '50', + $user = 'root', + $enable = true ) { + + require puppi + require puppi::params + + $ensure = bool2ensure($enable) + + file { "${puppi::params::projectsdir}/${project}/deploy/${priority}-${name}": + ensure => $ensure, + mode => '0750', + owner => $puppi::params::configfile_owner, + group => $puppi::params::configfile_group, + require => Class['puppi'], + content => "su - ${user} -c \"export project=${project} && ${puppi::params::scriptsdir}/${command} ${arguments}\"\n", + tag => 'puppi_deploy', + } + +} +