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] Use windows_agent_url to download script #656

Merged
merged 1 commit into from
Nov 14, 2019

Conversation

olivielpeau
Copy link
Member

Use case: if our S3 bucket is mirrored, we should also pull the script from local mirror.

We should also probably mention in the readme and/or changelog that on windows the cookbook expects a script to be present on local mirror (if any is used).

Note: should be backported to 2.x as well (and to the upcoming 4.x)

Use case: if our S3 bucket is mirrored, we should also pull the script from local mirror
@olivielpeau olivielpeau requested a review from truthbk November 13, 2019 18:32
Copy link
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

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

Added a note, but it's probably not something that changes anything unless we also do it elsewhere in the recipe.

@@ -106,7 +106,7 @@
# As of v1.37, the windows cookbook doesn't upgrade the package if a newer version is downloaded
# As a workaround uninstall the package first if a new MSI is downloaded
code <<-EOH
((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
((New-Object System.Net.WebClient).DownloadFile('#{node['datadog']['windows_agent_url']}scripts/fix_6_14.ps1', $env:temp + '\\fix_6_14.ps1')); &$env:temp\\fix_6_14.ps1
Copy link
Member

Choose a reason for hiding this comment

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

should we maybe use a helper var and do:

URI::join(node['datadog']['windows_agent_uri'], 'scripts/fix_6_14.ps1') 

?

Copy link
Member

Choose a reason for hiding this comment

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

OK, just realized we don't do this for the remote_file source, so we wouldn't even get this far. Probably not something we need to do.

Copy link
Member Author

Choose a reason for hiding this comment

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

indeed I used this for consistency, I think we can update both to use URI::join in a later PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Quick question, why do we use Powershell to download the script and not Chef's remote_file directly ?

@truthbk truthbk merged commit 9cfca8d into master Nov 14, 2019
truthbk pushed a commit that referenced this pull request Nov 15, 2019
Use case: if our S3 bucket is mirrored, we should also pull the script from local mirror
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.

3 participants