Puppet Class: signalfx_agent::win_repo

Defined in:
manifests/win_repo.pp

Overview

Downloads the SignalFx Agent executable

Parameters:

  • repo_base (Any)
  • package_stage (Any)
  • version (Any)
  • config_file_path (Any)
  • installation_directory (Any)
  • service_name (Any)


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'manifests/win_repo.pp', line 2

class signalfx_agent::win_repo (
  $repo_base,
  $package_stage,
  $version,
  $config_file_path,
  $installation_directory,
  $service_name,
) {

  $url = "https://${repo_base}/windows/${package_stage}/zip/SignalFxAgent-${version}-win64.zip"
  $zipfile_location = "${installation_directory}\\SignalFxAgent-${version}-win64.zip"

  file { $installation_directory:
    ensure => 'directory',
  }

  -> exec { 'Stop SignalFx Agent':
    command  => "Stop-Service -Name \'${service_name}\'",
    onlyif   => "((Get-CimInstance -ClassName win32_service -Filter 'Name = \'${service_name}\'' | Select Name, State).Name)",
    provider => 'powershell',
  }

  -> archive { $zipfile_location:
    source       => $url,
    extract_path => $installation_directory,
    group        => 'Administrator',
    user         => 'Administrator',
    extract      => true,
  }

  -> tidy { $installation_directory:
    recurse => 1,
    matches => ['*.zip'],
  }
}