dev/provisioning/modules/puppi/manifests/log.pp
author Chloe Laisne <chloe.laisne@gmail.com>
Thu, 07 Jul 2016 16:11:59 +0200
changeset 234 c928f6190771
parent 28 b0b56e0f8c7f
permissions -rwxr-xr-x
Select row in chronology

# Define puppi::log
#
# This define creates a basic log file that simply contains
# the list of logs to show when issuing the puppi log command.
#
# == Usage:
# puppi::log { "system":
#   description => "General System Logs" ,
#   log  => [ "/var/log/syslog" , "/var/log/messages" ],
# }
#
# :include:../README.log
#
define puppi::log (
  $log,
  $description = '' ) {

  require puppi
  require puppi::params

  $array_log = is_array($log) ? {
    false     => split($log, ','),
    default   => $log,
  }

  file { "${puppi::params::logsdir}/${name}":
    ensure  => 'present',
    mode    => '0644',
    owner   => $puppi::params::configfile_owner,
    group   => $puppi::params::configfile_group,
    require => Class['puppi'],
    content => template('puppi/log.erb'),
    tag     => 'puppi_log',
  }

}