dev/provisioning/modules/puppi/manifests/helper.pp
changeset 28 b0b56e0f8c7f
equal deleted inserted replaced
27:a2342f26c9de 28:b0b56e0f8c7f
       
     1 # Define puppi::helper
       
     2 #
       
     3 # The Puppi 2.0 define that creates an helper file that contains
       
     4 # the commands to execute, for the different puppi actions, using
       
     5 # the variables present in the datafile
       
     6 #
       
     7 # == Usage
       
     8 # Basic Usage:
       
     9 # puppi::helper { "myhelper":
       
    10 #   template => 'myproject/puppi/helpers/myhelper.erb',
       
    11 # }
       
    12 #
       
    13 define puppi::helper (
       
    14   $template,
       
    15   $ensure = 'present' ) {
       
    16 
       
    17   require puppi
       
    18   require puppi::params
       
    19 
       
    20   file { "puppi_helper_${name}":
       
    21     ensure  => $ensure,
       
    22     path    => "${puppi::params::helpersdir}/${name}.yml",
       
    23     mode    => '0644',
       
    24     owner   => $puppi::params::configfile_owner,
       
    25     group   => $puppi::params::configfile_group,
       
    26     content => template($template),
       
    27   }
       
    28 
       
    29 }