Skip to content

[windows] fixes + blacklist#578

Merged
truthbk merged 4 commits intomasterfrom
jaime/win_blacklist
Nov 15, 2019
Merged

[windows] fixes + blacklist#578
truthbk merged 4 commits intomasterfrom
jaime/win_blacklist

Conversation

@truthbk
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Comment thread manifests/params.pp Outdated
'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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👌

Comment thread manifests/windows/agent6.pp
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
Copy Markdown
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 <albert.vaca@datadoghq.com>
@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 <albert.vaca@datadoghq.com>
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