|
1 # Define puppi::info::module |
|
2 # |
|
3 # This is a puppi info plugin that provides automatic info to modules |
|
4 # It uses a default template puppi/info/module.erb that can be changed |
|
5 # and adapted |
|
6 # |
|
7 # == Usage |
|
8 # (Sample from Example42 apache module where there's wide use of |
|
9 # qualified variables, note that you can provide direct values to it |
|
10 # without using variables): |
|
11 # |
|
12 # puppi::info::module { "apache": |
|
13 # packagename => "${apache::params::packagename}", |
|
14 # servicename => "${apache::params::servicename}", |
|
15 # processname => "${apache::params::processname}", |
|
16 # configfile => "${apache::params::configfile}", |
|
17 # configdir => "${apache::params::configdir}", |
|
18 # pidfile => "${apache::params::pidfile}", |
|
19 # datadir => "${apache::params::datadir}", |
|
20 # logfile => "${apache::params::logfile}", |
|
21 # logdir => "${apache::params::logdir}", |
|
22 # protocol => "${apache::params::protocol}", |
|
23 # port => "${apache::params::port}", |
|
24 # description => "What Puppet knows about apache" , |
|
25 # run => "httpd -V", |
|
26 # } |
|
27 # |
|
28 define puppi::info::module ( |
|
29 $packagename = '', |
|
30 $servicename = '', |
|
31 $processname = '', |
|
32 $configfile = '', |
|
33 $configdir = '', |
|
34 $initconfigfile = '', |
|
35 $pidfile = '', |
|
36 $datadir = '', |
|
37 $logfile = '', |
|
38 $logdir = '', |
|
39 $protocol = '', |
|
40 $port = '', |
|
41 $description = '', |
|
42 $run = '', |
|
43 $verbose = 'no', |
|
44 $templatefile = 'puppi/info/module.erb' ) { |
|
45 |
|
46 require puppi |
|
47 require puppi::params |
|
48 |
|
49 file { "${puppi::params::infodir}/${name}": |
|
50 ensure => present, |
|
51 mode => '0750', |
|
52 owner => $puppi::params::configfile_owner, |
|
53 group => $puppi::params::configfile_group, |
|
54 require => Class['puppi'], |
|
55 content => template($templatefile), |
|
56 tag => 'puppi_info', |
|
57 } |
|
58 |
|
59 } |