refactored puppet layout

This commit is contained in:
root 2016-11-09 12:48:19 +01:00
parent 2678407333
commit 5a32964fe9
5 changed files with 62 additions and 56 deletions

View File

@ -1,29 +1,4 @@
$dynatrace = hiera('dynatrace')
notice('MODULAR: dynatrace/dynatrace-agent.pp')
$tenant = $dynatrace['dynatrace_tenant']
$token = $dynatrace['dynatrace_token']
$managed = $dynatrace['dynatrace_managed']
$server = $dynatrace['dynatrace_server']
$file = "/tmp/Dynatrace-OneAgent.sh"
if ($managed) {
$url = "https://${server}/e/${tenant}/installer/agent/unix/latest/${token}/${tenant}"
}
else {
$url = "https://${tenant}.live.dynatrace.com/installer/agent/unix/latest/${token}"
}
file { '/etc/hiera/plugins/dynatrace.yaml':
ensure => file,
} ->
download {'Download Dynatrace OneAgent':
uri => $url,
dest => $file
} ->
exec { 'install_oneagent':
command => "/bin/sh ${file} APP_LOG_CONTENT_ACCESS=1",
path => $::path
}
include dynatrace
class { 'dynatrace::oneagent': }

View File

@ -1,29 +1,4 @@
$dynatrace = hiera('dynatrace')
notice('MODULAR: dynatrace/dynatrace-security-gateway.pp')
$tenant = $dynatrace['dynatrace_tenant']
$token = $dynatrace['dynatrace_token']
$managed = $dynatrace['dynatrace_managed']
$server = $dynatrace['dynatrace_server']
$file = "/tmp/Dynatrace-Security-Gateway.sh"
if ($managed) {
$url = "https://${server}/e/${tenant}/installer/sg/unix/latest/${token}/${tenant}"
}
else {
$url = "https://${tenant}.live.dynatrace.com/installer/sg/unix/latest/${token}"
}
file { '/etc/hiera/plugins/dynatrace.yaml':
ensure -> file,
} ->
download {'Download Dynatrace Security Gateway':
uri => $url,
dest => $file
} ->
exec { 'install_security_gateway':
command => "/bin/sh ${file}",
path => $::path
}
include dynatrace
class { 'dynatrace::security_gateway': }

View File

@ -0,0 +1,8 @@
class dynatrace {
$dynatrace = hiera('dynatrace')
$tenant = $dynatrace['dynatrace_tenant']
$token = $dynatrace['dynatrace_token']
$managed = $dynatrace['dynatrace_managed']
$server = $dynatrace['dynatrace_server']
}

View File

@ -0,0 +1,24 @@
class dynatrace::oneagent {
$file = "/tmp/Dynatrace-OneAgent.sh"
if ($dynatrace::managed) {
$url = "https://${dynatrace::server}/e/${dynatrace::tenant}/installer/agent/unix/latest/${dynatrace::token}/${dynatrace::tenant}"
}
else {
$url = "https://${dynatrace::tenant}.live.dynatrace.com/installer/agent/unix/latest/${dynatrace::token}"
}
file { '/etc/hiera/plugins/dynatrace.yaml':
ensure => file,
} ->
download {'Download Dynatrace OneAgent':
uri => $url,
dest => $file
} ->
exec { 'install_oneagent':
command => "/bin/sh ${file} APP_LOG_CONTENT_ACCESS=1",
path => $::path
}
}

View File

@ -0,0 +1,24 @@
class dynatrace::security_gateway {
$file = "/tmp/Dynatrace-Security-Gateway.sh"
if ($dynatrace::managed) {
$url = "https://${dynatrace::server}/e/${dynatrace::tenant}/installer/sg/unix/latest/${dynatrace::token}/${dynatrace::tenant}"
}
else {
$url = "https://${dynatrace::tenant}.live.dynatrace.com/installer/sg/unix/latest/${dynatrace::token}"
}
file { '/etc/hiera/plugins/dynatrace.yaml':
ensure => file,
} ->
download {'Download Dynatrace Security Gateway':
uri => $url,
dest => $file
} ->
exec { 'install_security_gateway':
command => "/bin/sh ${file} APP_LOG_CONTENT_ACCESS=1",
path => $::path
}
}