xymon::client::install : Create download directory

This commit is contained in:
gardouille 2015-02-10 12:00:10 +01:00
parent 9bf5128782
commit 1cab78e5d6
3 changed files with 72 additions and 0 deletions

32
manifests/client.pp Normal file
View File

@ -0,0 +1,32 @@
# == Class: xymon::client
#
# Manage installation and configuration of Xymon client.
#
# === Parameters
#
#
# === Variables
#
#
# === Examples
#
# class { 'xymon::client':
# }
#
# === Authors
#
# Gardouille <gardouille@gmail.com>
#
# === Copyright
#
# WTFPL <http://wtfpl.org/>
#
class xymon::client (
$download_dir = $xymon::params::download_dir,
$cli_new_version = $xymon::params::cli_new_version,
$cli_old_version = $xymon::params::cli_old_version,
) inherits xymon::params {
include '::xymon::client::install'
} # Public class: xymon::client

View File

@ -0,0 +1,20 @@
# == Class: xymon::client::install
#
# Install Xymon client
#
class xymon::client::install {
Exec {
path => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
logoutput => 'on_failure',
}
exec { 'Create download directory for Xymon client package':
command => "mkdir -p -- ${xymon::client::download_dir}",
creates => $xymon::client::download_dir,
}
} # Private class: xymon::client::install

20
manifests/params.pp Normal file
View File

@ -0,0 +1,20 @@
# == Class: xymon::params
#
class xymon::params {
case $::osfamily {
'Debian': {
# Client
$download_dir = '/opt/xymon/packages'
$cli_new_version = '4.3.18'
$cli_old_version = '4.3.17'
}
default: {
fail('This Puppet module has been tested only on Debian OS family.')
}
}
} # Private class: xymon::params