-
Notifications
You must be signed in to change notification settings - Fork 228
[Windows] Force reinstall if configuration changed [AP-1946] #509
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
Conversation
tasks/pkg-windows.yml
Outdated
set_fact: | ||
agent_datadog_skip_install: >- | ||
{{ agent_config_install_args.exists and | ||
agent_config_install_args.value != agent_win_install_args }} |
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.
Shouldn't we skip the install when the provided args match the previous one stored in the registry? It looks like agent_config_install_args.value != agent_win_install_args
will set agent_datadog_skip_install
to true when they are not the same.
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.
Hm, indeed you are correct the logic is inverted, which means something else is wrong since the install was still forced during my tests
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 found the issue, it was somewhere between the chair and the keyboard (I forgot to pin the version so I was checking with a agent_datadog_skip_install
set to false, meaning I didn't test anything valuable)
bca37b8
to
14dcaf8
Compare
73043a3
to
97e8015
Compare
tasks/pkg-windows-opts.yml
Outdated
@@ -12,6 +16,23 @@ | |||
agent_win_install_args: "{{ win_install_args }} DDAGENTUSER_NAME={{ datadog_windows_ddagentuser_name }}" | |||
when: datadog_windows_ddagentuser_name | default('', true) | length > 0 | |||
|
|||
- name: Get Windows Agent config |
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.
- name: Get Windows Agent config | |
- name: Get Windows Agent features |
The term config for the Agent normally refers to the configuration files, I think this could cause confusion here since this code extracts the installer features.
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.
renamed
tasks/pkg-windows-opts.yml
Outdated
@@ -90,3 +111,16 @@ | |||
set_fact: | |||
agent_win_install_args: "{{ agent_win_install_args }} ADDLOCAL=MainApplication,NPM" | |||
when: agent_datadog_sysprobe_enabled | |||
|
|||
# Check for potential config changes that require a reinstall: | |||
- name: Check NPM config change |
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.
- name: Check NPM config change | |
- name: Check NPM feature change |
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.
renamed
# reported as such regardless of the provided parameters. Since we don't | ||
# want to force the install for nothing in those version, we skip the step | ||
# when the agent is 7.45+ | ||
when: >- |
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 wonder if we should also print a message to inform the user of this change in behavior ?
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.
Added a debug message to let the users know
This will help for [AP-1946] and allows us to detect if the NPM driver is installed on old agent installations
We will soon override agent_datadog_skip_install within this file so the updated value must be available ASAP
97e8015
to
f463387
Compare
Thanks for the review! I pushed an additional commit per your suggestions (and rebased on top of main) |
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.
LGTM!
This PR adds support for optional features exposed by the MSI installer.
It will probe the available features and will trigger a reinstall if an optional features must be enabled/disabled (the installer doesn't support in place modification of the installed features)
While this is of limited interest given that the installer always installs all features since 7.46, this paves the way for future optional features that we might not want to systematically install