-
Notifications
You must be signed in to change notification settings - Fork 158
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 Installer Script - Add support for offline installs #4471
Conversation
The original collector installer script allows you to use a local downloaded file for the Otel Collector MSI by using the parameter msi_path. However, if you enable the with_dotnet_instrumentation to install the .net auto instrumentation, that part of the installer script does not support manually downloading files and for many server environments this section will fail. You then end up with a partially installed set of collector and instrumentation. The changes are designed to support fully offline installs of both the collector and the .net auto instrumentation when using the combination of these new params and the previously existing msi_path. New Params: dotnet_psm1_path: (OPTIONAL) Specify a local path to a Splunk OpenTelemetry .NET Auto Instrumentation Powershell Module file (.psm1) instead of downloading the package. This module will be used to install the .NET auto instrumentation files. dotnet_auto_zip_path: (OPTIONAL) Specify a local path to a Splunk OpenTelemetry .NET Auto Instrumentation zip package that will be installed by the dotnet psm1 module instead of downloading the package. force_skip_verify_access_token: (OPTIONAL) Forces the skipping the verification check of the Splunk Observability Access Token regardless of what is in the env variable VERIFY_ACCESS_TOKEN. This is helpful on new installs where access might be an issue or the token isn't created yet.
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this change @bryan-splunk!
Some minor stuff to change before we can merge it.
} else { | ||
$dotnet_autoinstr_path = $dotnet_psm1_path | ||
echo "Using Local PSM1 file and ArgumentList values: $dotnet_psm1_path -ArgumentList $dotnet_auto_zip_path" | ||
Import-Module $dotnet_autoinstr_path -ArgumentList $dotnet_auto_zip_path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think -ArgumentList
is needed here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it with the -ArgumentList and the values were successfully passed to the PSM1 file. I didn't try without it. I found this method of passing arguments in this StackOverflow article.
https://stackoverflow.com/questions/36897511/powershell-module-pass-a-parameter-while-importing-module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't matter in this case because the module doesn't have module level parameters.
fixed spacing Co-authored-by: Paulo Janotti <pjanotti@splunk.com>
removed double quotes on variable Co-authored-by: Paulo Janotti <pjanotti@splunk.com>
# If the variable dotnet_auto_zip_path is an empty string, then the Installer will download the .NET Instrumentation from the default repository.
Description: Added support for offline installs to the Windows Installer Script. Its common for windows servers in the DMZ to have outbound access blocked which prevents the current script from working. The current script does support an offline MSI but it does NOT support an offline .net auto instrumentation file. This change adds that capability.
Link to Splunk idea: There is no idea for this, but this is something we see in field sales all the time. Support tosses this issue back to the SAs/SEs so I lets just fix the root cause.
Testing: Ran the script multiple times with various options in my Home Lab using Win Server 2012R2 with powershell 5.1. I believe it needs more testing, but my home lab resources are limited. Hopefully the QA team can put it through the paces.
Documentation: Added Param documentation to the script file to support the Get-Help command. Other comments are in line.
How To Use This Script
The original collector installer script allows you to use a local downloaded file for the Otel Collector MSI by using the parameter msi_path. However, if you enable the with_dotnet_instrumentation to install the .net auto instrumentation, that part of the installer script does not support manually downloading files and for many server environments this section will fail. You then end up with a partially installed set of collector and instrumentation. The script changes are designed to support fully offline installs of both the collector and the .net auto instrumentation when using the combination of these new params and the previously existing msi_path.
New Params:
Example Command Line:
Please note my example has the "." to call the script and depending on your setup you may need to use a different setup. This command also requires Administrator permissions to be sure to open a powershell window as administrator. For ease of use, I also copy all the binaries and this new script into the same folder. In the example below I also using the option force_skip_verify_access_token as its common for new servers in a DMZ to all outbound traffic blocked. Blocked traffic result in the access_token verification process failing and then the installer will error out and stop. This options allows you to skip that check and continue with the install. However data will not flow into Splunk Observability until the proper ports are open.
Known Issues: