Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[windows] fixes + blacklist #578

Merged
merged 4 commits into from
Nov 15, 2019
Merged

[windows] fixes + blacklist #578

merged 4 commits into from
Nov 15, 2019

Conversation

truthbk
Copy link
Member

@truthbk truthbk commented Nov 14, 2019

No description provided.

fail("The specified agent version has been blacklisted, please specify a version other than 6.14.0 or 6.14.1")
}

file { 'installer':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous behavior was to only download the MSI if it wasn't already installed. Now we are downloading it regardless. Any reason to prefer this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I missed something with my testing, but it didn't seem to download regardless. Once the file is in the temp directory I don't think the download was reattempted (ie. this resource doesn't behave like the chef counterpart that always pulls).

That said, we can go back to the original code. I made this change because I wanted to use the validate_cmd, but it didn't work particularly well in my tests, so I eventually did the validation in the exec resource below. We could still do it the way it was before, but I left it like this because the behavior seemed similar. I can try to reconfirm this doesn't always download.

The one thing that sucks, and I might change in a separate PR, is the fact we keep multiple files lying around, using up more and more disk space in temp over time. It might make sense to make msi_full_path a constant where we always overwrite with what we pull from the source (if it's not chatty).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't always download, but clearing the temp directory will trigger a download that is not needed if the package is already installed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tentative fix, yet to be tested: #582

@@ -65,7 +65,7 @@
}
'Windows': {
$agent5_default_repo = '<agent 5 is not supported by this module on windows>' # Param in init.pp so needs to be defined, but not used on Windows
$agent6_default_repo = "https://s3.amazonaws.com/ddagent-windows-stable/datadog-agent-6-${agent_version}.amd64.msi"
$agent6_default_repo = "https://s3.amazonaws.com/ddagent-windows-stable/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

manifests/windows/agent6.pp Show resolved Hide resolved
notify => Package[$datadog_agent::params::package_name]
}

package { $datadog_agent::params::package_name:
ensure => installed,
provider => 'windows',
source => $msi_full_path,
install_options => ['/quiet', {'APIKEY' => $api_key, 'HOSTNAME' => $hostname, 'TAGS' => $tags}]
install_options => ['/norestart', {'APIKEY' => $api_key, 'HOSTNAME' => $hostname, 'TAGS' => $tags}]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

Apply suggestions from code review

Co-Authored-By: Albert Vaca <[email protected]>
@truthbk truthbk force-pushed the jaime/win_blacklist branch from 63441ec to e1cb79a Compare November 15, 2019 19:49
@truthbk truthbk merged commit f09ac51 into master Nov 15, 2019
@truthbk truthbk deleted the jaime/win_blacklist branch November 15, 2019 22:05
cegeka-jenkins pushed a commit to cegeka/puppet-datadog_agent that referenced this pull request Apr 6, 2020
* [windows] apply powershell remote fix before uninstall + idiomatic download

* [windows] weak first attempt to blacklist bad MSIs

* [windows] multiple fixes + blacklist + hash validation

* addressing cops

Apply suggestions from code review

Co-Authored-By: Albert Vaca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants