Skip to content

Conversation

@tbavelier
Copy link
Member

@tbavelier tbavelier commented Nov 17, 2025

What does this PR do

Introduces for Windows two new parameters publicly available:

  • datadog_windows_skip_install: skip install-related tasks
  • datadog_windows_force_reinstall: force reinstallation:
    • Currently, we do not allow downgrades, only same version change to enable NPM. This PR allows to now downgrade by having the role uninstall the installed version before installing the new one, going over the MSI limitation when providing the parameter

Motivation

Currently, we have internal facts:

  • agent_datadog_skip_install: skip install if we detect the desired version is already installed. On Windows, unlike Linux, not specifying a version always re-installs latest since we can't know unlike on Linux when using package managers
  • agent_datadog_force_reinstall: force reinstall if NPM is enabled
    - name: Check NPM feature change to force a reinstallation if enabled features have changed
    ansible.builtin.set_fact:
    agent_datadog_skip_install: false
    agent_datadog_force_reinstall: true

Now, this logic can be overridden explicitly by users providing these values in their playbook.

QA

Already tested on Windows:

  • datadog_windows_skip_install: on a bare VM (no Agent installed), use a playbook with datadog_windows_skip_install: true and ensure the Agent doesn't get installed, it will error out later since C:\ProgramData\Datadog does not exist

    • Then, install the Agent by removing the variable, and re-add it, ensure the latest does not get re-downloaded
    Without datadog_windows_skip_install With datadog_windows_skip_install
    image image
  • datadog_windows_force_reinstall: provide datadog_windows_force_reinstall: true and datadog_agent_version and ensure the same version gets re-installed / provide a lower datadog_agent_version and it should downgrade instead of erroring. Example below starting from 7.72.2 and trying to downgrade to 7.70.1

Without datadog_windows_force_reinstall With datadog_windows_force_reinstall
image image

@tbavelier tbavelier marked this pull request as ready for review November 17, 2025 16:59
@tbavelier tbavelier requested review from a team as code owners November 17, 2025 16:59
@urseberry urseberry self-assigned this Nov 17, 2025
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