From 0f777de2716ac324fe89b5d4672971fbbfbd3f71 Mon Sep 17 00:00:00 2001 From: Max Wilhelm Date: Mon, 30 Nov 2015 17:04:14 +0100 Subject: [PATCH] added fluentd::install --- manifests/init.pp | 12 ++++++++++-- manifests/install.pp | 11 +++++++++++ manifests/params.pp | 6 +++++- 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 manifests/install.pp diff --git a/manifests/init.pp b/manifests/init.pp index 605f787..d1e68e0 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -43,15 +43,23 @@ # Copyright 2015 Your name here, unless otherwise noted. # class fluentd ( - $ensure = $::fluentd::params::ensure, - $manage_repo = $::fluentd::params::manage_repo, + $ensure = $::fluentd::params::ensure, + $manage_repo = $::fluentd::params::manage_repo, + $package_ensure = $::fluentd::params::package_ensure, + $package_name = $::fluentd::params::package_name, + $package_install_options = $::fluentd::params::package_install_options, ) inherits fluentd::params { validate_string($ensure) validate_bool($manage_repo) + validate_string($package_ensure) + validate_string($package_name) + validate_array($package_install_options) if $manage_repo { class { '::fluentd::repo': } } + class { '::fluentd::install': } + } diff --git a/manifests/install.pp b/manifests/install.pp new file mode 100644 index 0000000..af1cd32 --- /dev/null +++ b/manifests/install.pp @@ -0,0 +1,11 @@ +# Configure package +# +class fluentd::install inherits fluentd { + + package { 'fluentd': + ensure => $package_ensure, + name => $package_name, + install_options => $package_install_options, + } + +} diff --git a/manifests/params.pp b/manifests/params.pp index ce0973a..342865f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,5 +1,9 @@ class fluentd::params { - $ensure = 'present' + $ensure = 'present' + + $package_ensure = 'installed' + $package_name = 'td-agent' + $package_install_options = [] case $::osfamily { 'Debian': {