Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Download and install Wily Kafka APM agent
- if ($wily_kafka_apm_source != undef) {
- # create directory for agent
- exec { 'create-kafka-wily-apm-dir':
- cwd => '/',
- path => ['/usr/bin', '/bin'],
- command => "mkdir -p ${wily_kafka_apm_dir}",
- creates => $wily_kafka_apm_dir;
- }
- $filenameArray = split($wily_kafka_apm_source, '/')
- $basefilename = $filenameArray[-1]
- #grab down the file into the directory/filename on destination
- # The variable $wily_kafka_apm_source needs to be defined as either HTTP/HTTPS
- exec { 'download-wily-kafka-apm-package':
- command => "wget -O ${wily_kafka_apm_dir}/${basefilename} $wily_kafka_apm_source 2> /dev/null",
- path => ['/usr/bin', '/bin'],
- creates => "${wily_kafka_apm_dir}/${basefilename}",
- umask => '022',
- require => File[$wily_kafka_apm_dir]
- } ~>
- exec { 'extract-wily-kafka-apm-package':
- command => "tar -xzvf ${wily_kafka_apm_dir}/${basefilename} -C ${wily_kafka_apm_dir}",
- #require => File["${wily_kafka_apm_dir}/${basefilename}"],
- user => 'kafka',
- path => ["/bin", "/usr/bin", "/usr/sbin"],
- creates => "${wily_kafka_apm_dir}/${basefilename}/apmia",
- }
- # file { "${wily_kafka_apm_dir}/${basefilename}":
- file { "${wily_kafka_apm_dir}":
- ensure => present
- }
- #
- # }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement