summaryrefslogtreecommitdiff
path: root/manifests/agent/install.pp
diff options
context:
space:
mode:
authorMicah <micah@leap.se>2016-05-24 10:19:41 -0400
committerMicah <micah@leap.se>2016-05-24 10:19:41 -0400
commitc9d50f333a81c716f3e227e9eb449dc76b6eb6e3 (patch)
tree1a09a2775045f854000f6cba5ee4efb2c3a802b2 /manifests/agent/install.pp
Squashed 'puppet/modules/check_mk/' content from commit aa02571
git-subtree-dir: puppet/modules/check_mk git-subtree-split: aa02571537af90ac73309e6e216c9417802548c3
Diffstat (limited to 'manifests/agent/install.pp')
-rw-r--r--manifests/agent/install.pp70
1 files changed, 70 insertions, 0 deletions
diff --git a/manifests/agent/install.pp b/manifests/agent/install.pp
new file mode 100644
index 00000000..5c0b56ef
--- /dev/null
+++ b/manifests/agent/install.pp
@@ -0,0 +1,70 @@
+class check_mk::agent::install (
+ $version = '',
+ $filestore = '',
+ $workspace,
+ $agent_package_name,
+ $agent_logwatch_package_name,
+ $method = 'xinetd',
+) {
+ if $method == 'xinetd' {
+ if ! defined($require_method) {
+ package { 'xinetd':
+ ensure => latest,
+ }
+ }
+ $require_method = 'Package[\'xinetd\']'
+ } else {
+ $require_method = undef
+ }
+
+ if $filestore {
+ if ! defined(File[$workspace]) {
+ file { $workspace:
+ ensure => directory,
+ }
+ }
+ file { "${workspace}/check_mk-agent-${version}.noarch.rpm":
+ ensure => latest,
+ source => "${filestore}/check_mk-agent-${version}.noarch.rpm",
+ require => $require_method,
+ }
+ file { "${workspace}/check_mk-agent-logwatch-${version}.noarch.rpm":
+ ensure => latest,
+ source => "${filestore}/check_mk-agent-logwatch-${version}.noarch.rpm",
+ require => $require_method,
+ }
+ package { 'check_mk-agent':
+ ensure => latest,
+ provider => 'rpm',
+ source => "${workspace}/check_mk-agent-${version}.noarch.rpm",
+ require => File["${workspace}/check_mk-agent-${version}.noarch.rpm"],
+ }
+ package { 'check_mk-agent-logwatch':
+ ensure => latest,
+ provider => 'rpm',
+ source => "${workspace}/check_mk-agent-logwatch-${version}.noarch.rpm",
+ require => [
+ File["${workspace}/check_mk-agent-logwatch-${version}.noarch.rpm"],
+ Package['check_mk-agent'],
+ ],
+ }
+ }
+ else {
+ if $version {
+ $agent_package_version = $version
+ } else {
+ $agent_package_version = latest
+ }
+
+ package { 'check_mk-agent':
+ ensure => $agent_package_version,
+ name => $agent_package_name,
+ require => $require_method,
+ }
+ package { 'check_mk-agent-logwatch':
+ ensure => $agent_package_version,
+ name => $agent_logwatch_package_name,
+ require => Package['check_mk-agent'],
+ }
+ }
+}