dev/provisioning/modules/puppi/manifests/info/module.pp
author ymh <ymh.work@gmail.com>
Fri, 15 Jan 2016 15:35:00 +0100
changeset 28 b0b56e0f8c7f
permissions -rwxr-xr-x
Add contributor edition - added viaf resolver - improve contributors list display - add update of document objects - propagate update to back office - update back office - add bo-client to back office - setup language initializer - add options mechanism - add language information in language list - add lexvo resolver service + api - add language and lexvo resolver to js app - correct env template - refresh bootstrap - download google font - add version information - update dev virtual machine to centos7 - add a readme + clean folders - add local .env file to start commands

# Define puppi::info::module
#
# This is a puppi info plugin that provides automatic info to modules
# It uses a default template puppi/info/module.erb that can be changed
# and adapted
#
# == Usage
# (Sample from Example42 apache module where there's wide use of
# qualified variables, note that you can provide direct values to it
# without using variables):
#
#  puppi::info::module { "apache":
#    packagename => "${apache::params::packagename}",
#    servicename => "${apache::params::servicename}",
#    processname => "${apache::params::processname}",
#    configfile  => "${apache::params::configfile}",
#    configdir   => "${apache::params::configdir}",
#    pidfile     => "${apache::params::pidfile}",
#    datadir     => "${apache::params::datadir}",
#    logfile     => "${apache::params::logfile}",
#    logdir      => "${apache::params::logdir}",
#    protocol    => "${apache::params::protocol}",
#    port        => "${apache::params::port}",
#    description => "What Puppet knows about apache" ,
#    run         => "httpd -V",
#  }
#
define puppi::info::module (
  $packagename    = '',
  $servicename    = '',
  $processname    = '',
  $configfile     = '',
  $configdir      = '',
  $initconfigfile = '',
  $pidfile        = '',
  $datadir        = '',
  $logfile        = '',
  $logdir         = '',
  $protocol       = '',
  $port           = '',
  $description    = '',
  $run            = '',
  $verbose        = 'no',
  $templatefile   = 'puppi/info/module.erb' ) {

  require puppi
  require puppi::params

  file { "${puppi::params::infodir}/${name}":
    ensure  => present,
    mode    => '0750',
    owner   => $puppi::params::configfile_owner,
    group   => $puppi::params::configfile_group,
    require => Class['puppi'],
    content => template($templatefile),
    tag     => 'puppi_info',
  }

}