Advertisement
andrewglass3

Untitled

Sep 17th, 2018
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.75 KB | None | 0 0
  1.         # Download and install Wily Kafka APM agent
  2.         if ($wily_kafka_apm_source != undef) {
  3.                 # create directory for agent
  4.                 exec { 'create-kafka-wily-apm-dir':
  5.                   cwd   => '/',
  6.                   path  => ['/usr/bin', '/bin'],
  7.                   command => "mkdir -p ${wily_kafka_apm_dir}",
  8.                   creates => $wily_kafka_apm_dir;
  9.                 }
  10.  
  11.                 $filenameArray = split($wily_kafka_apm_source, '/')
  12.                 $basefilename = $filenameArray[-1]
  13.  
  14.                 #grab down the file into the directory/filename on destination
  15.                 # The variable $wily_kafka_apm_source needs to be defined as either HTTP/HTTPS
  16.                 exec { 'download-wily-kafka-apm-package':
  17.                   command => "wget -O ${wily_kafka_apm_dir}/${basefilename} $wily_kafka_apm_source 2> /dev/null",
  18.                   path    => ['/usr/bin', '/bin'],
  19.                   creates => "${wily_kafka_apm_dir}/${basefilename}",
  20.                   umask   => '022',
  21.                   require => File[$wily_kafka_apm_dir]
  22.                 } ~>
  23.  
  24.                  exec { 'extract-wily-kafka-apm-package':
  25.                   command => "tar -xzvf ${wily_kafka_apm_dir}/${basefilename} -C ${wily_kafka_apm_dir}",
  26.                   #require => File["${wily_kafka_apm_dir}/${basefilename}"],
  27.  
  28.                   user    => 'kafka',
  29.                   path    => ["/bin", "/usr/bin", "/usr/sbin"],
  30.                   creates => "${wily_kafka_apm_dir}/${basefilename}/apmia",
  31.                 }
  32.  
  33. #               file { "${wily_kafka_apm_dir}/${basefilename}":
  34.                 file { "${wily_kafka_apm_dir}":
  35.                   ensure => present
  36.                 }
  37. #
  38. #               }
  39.  
  40.         }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement