equal
deleted
inserted
replaced
|
1 # Define puppi::info |
|
2 # |
|
3 # This define creates a basic info file that simply contains a set |
|
4 # of commands that show infos about custom topics. |
|
5 # To be used by the puppi info command. |
|
6 # By default it builds the info script based on the minimal puppi/info.erb |
|
7 # template but you can choose a custom template. |
|
8 # Other info defines are used to gather and create puppi info scripts with |
|
9 # different arguments and contents. |
|
10 # Check puppi/manifests/info/ for alternative puppi::info:: plugins |
|
11 # |
|
12 # == Usage: |
|
13 # puppi::info { "network": |
|
14 # description => "Network status and information" , |
|
15 # run => [ "ifconfig" , "route -n" ], |
|
16 # } |
|
17 # |
|
18 # :include:../README.info |
|
19 # |
|
20 define puppi::info ( |
|
21 $description = '', |
|
22 $templatefile = 'puppi/info.erb', |
|
23 $run = '' ) { |
|
24 |
|
25 require puppi |
|
26 require puppi::params |
|
27 |
|
28 $array_run = is_array($run) ? { |
|
29 false => $run ? { |
|
30 '' => [], |
|
31 default => split($run, ','), |
|
32 }, |
|
33 default => $run, |
|
34 } |
|
35 |
|
36 file { "${puppi::params::infodir}/${name}": |
|
37 ensure => present, |
|
38 mode => '0750', |
|
39 owner => $puppi::params::configfile_owner, |
|
40 group => $puppi::params::configfile_group, |
|
41 require => Class['puppi'], |
|
42 content => template($templatefile), |
|
43 tag => 'puppi_info', |
|
44 } |
|
45 |
|
46 } |