|
21 | 21 |
|
22 | 22 | if $ensure == 'present' { |
23 | 23 | if ($agent_version in ['6.14.0', '6.14.1']) { |
24 | | - fail("The specified agent version has been blacklisted, please specify a version other than 6.14.0 or 6.14.1") |
| 24 | + fail('The specified agent version has been blacklisted, please specify a version other than 6.14.0 or 6.14.1') |
25 | 25 | } |
26 | 26 |
|
27 | 27 | file { 'installer': |
28 | | - path => $msi_full_path, |
29 | | - source => "${msi_source}", |
| 28 | + path => $msi_full_path, |
| 29 | + source => $msi_source, |
30 | 30 | provider => 'windows', |
31 | 31 | } |
32 | 32 |
|
33 | 33 | exec { 'validate': |
34 | | - command => "\$blacklist = '928b00d2f952219732cda9ae0515351b15f9b9c1ea1d546738f9dc0fda70c336','78b2bb2b231bcc185eb73dd367bfb6cb8a5d45ba93a46a7890fd607dc9188194';\$fileStream = [system.io.file]::openread('${msi_full_path}'); \$hasher = [System.Security.Cryptography.HashAlgorithm]::create('sha256'); \$hash = \$hasher.ComputeHash(\$fileStream); \$fileStream.close(); \$fileStream.dispose();\$hexhash = [system.bitconverter]::tostring(\$hash).ToLower().replace('-','');if (\$hexhash -match \$blacklist) { Exit 1 }", |
35 | | - provider => 'powershell', |
| 34 | + command => "\$blacklist = '928b00d2f952219732cda9ae0515351b15f9b9c1ea1d546738f9dc0fda70c336','78b2bb2b231bcc185eb73dd367bfb6cb8a5d45ba93a46a7890fd607dc9188194';\$fileStream = [system.io.file]::openread('${msi_full_path}'); \$hasher = [System.Security.Cryptography.HashAlgorithm]::create('sha256'); \$hash = \$hasher.ComputeHash(\$fileStream); \$fileStream.close(); \$fileStream.dispose();\$hexhash = [system.bitconverter]::tostring(\$hash).ToLower().replace('-','');if (\$hexhash -match \$blacklist) { Exit 1 }", |
| 35 | + provider => 'powershell', |
36 | 36 | logoutput => 'on_failure', |
37 | | - notify => Package[$datadog_agent::params::package_name] |
| 37 | + require => File['installer'], |
| 38 | + notify => Package[$datadog_agent::params::package_name] |
38 | 39 | } |
39 | 40 |
|
40 | 41 | package { $datadog_agent::params::package_name: |
|
51 | 52 | } |
52 | 53 | } else { |
53 | 54 | exec { 'datadog_6_14_fix': |
54 | | - command => "((New-Object System.Net.WebClient).DownloadFile('https://s3.amazonaws.com/ddagent-windows-stable/scripts/fix_6_14.ps1', \$env:temp + '\\fix_6_14.ps1')); &\$env:temp\\fix_6_14.ps1", |
| 55 | + command => "((New-Object System.Net.WebClient).DownloadFile('https://s3.amazonaws.com/ddagent-windows-stable/scripts/fix_6_14.ps1', \$env:temp + '\\fix_6_14.ps1')); &\$env:temp\\fix_6_14.ps1", |
55 | 56 | provider => 'powershell', |
56 | 57 | } |
57 | 58 |
|
|
0 commit comments