From 749c64a93633ac92381fb533764fc278a837e55c Mon Sep 17 00:00:00 2001 From: Gardouille Date: Fri, 20 Feb 2015 11:42:31 +0100 Subject: [PATCH] xymon::server::install : Install Xymon server package. --- manifests/params.pp | 2 ++ manifests/server.pp | 12 +++++++----- manifests/server/install.pp | 14 ++++++++------ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 3bcb52c..f8f39c5 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -44,6 +44,8 @@ class xymon::params { $srv_download_url = undef $srv_new_version = '4.3.17' $srv_package_name = undef + $srv_pkg_ensure = 'present' + $srv_pkg_provider = 'dpkg' } default: { diff --git a/manifests/server.pp b/manifests/server.pp index a06cc8d..75da73f 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -22,11 +22,13 @@ # WTFPL # class xymon::server ( - $dep_pkg_name = $xymon::params::srv_dep_pkg_name, - $download_dir = $xymon::params::srv_download_dir, - $download_url = $xymon::params::srv_download_url, - $new_version = $xymon::params::srv_new_version, - $package_name = $xymon::params::srv_package_name, + $dep_pkg_name = $xymon::params::srv_dep_pkg_name, + $download_dir = $xymon::params::srv_download_dir, + $download_url = $xymon::params::srv_download_url, + $new_version = $xymon::params::srv_new_version, + $package_name = $xymon::params::srv_package_name, + $pkg_ensure = $xymon::params::srv_pkg_ensure, + $pkg_provider = $xymon::params::srv_pkg_provider, ) inherits xymon::params { if ! defined(Class['::xymon::client']) { diff --git a/manifests/server/install.pp b/manifests/server/install.pp index 4a34e3a..fe4bfee 100644 --- a/manifests/server/install.pp +++ b/manifests/server/install.pp @@ -20,12 +20,14 @@ class xymon::server::install { cwd => $xymon::server::download_dir, creates => "${xymon::server::download_dir}/${xymon::server::preconfig::pkg_name}", } - #-> - # Install Xymon server package - #package { $xymon::server::package_name: - #ensure => present, - #require => [ Package[$xymon::server::dep_pkg_name], Class['::xymon::server'] ], - #} + -> + # Install Xymon server package + package { 'xymon-server': + ensure => $xymon::server::pkg_ensure, + provider => $xymon::server::pkg_provider, + source => "${xymon::server::download_dir}/${xymon::server::preconfig::pkg_name}", + } + } # Private class: xymon::server::install