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

Role downloads agent when current version is already up to date #265

Open
marchenm opened this issue Mar 5, 2020 · 8 comments
Open

Role downloads agent when current version is already up to date #265

marchenm opened this issue Mar 5, 2020 · 8 comments

Comments

@marchenm
Copy link

marchenm commented Mar 5, 2020

On windows, the role isn't idempotent. It will download the agent every single time even when there isn't a change. There should be a preliminary version check before downloading the agent.

@KSerrania
Copy link
Contributor

Hi @marchenm,

Thanks for the report! I made a PR: #269 to add logic to not download the msi if the detected installed version is the same as the set datadog_agent_version, which should fix the idempotency problem for pinned installs (for "latest" installs, the problem is more complex since we can't currently know what the latest package will install without downloading it, so this PR doesn't cover it).

@marchenm
Copy link
Author

marchenm commented Mar 6, 2020

https://docs.ansible.com/ansible/latest/modules/github_release_module.html

This module should be able to give you the latest release version

@KSerrania
Copy link
Contributor

Thanks for the suggestion, however while this module could help in some cases, using the github releases won't work everytime, for two main reasons:

  • there can be linux-only or windows-only releases of the datadog-agent (especially bugfix releases); if the latest release is a linux-only release, this module would return a version that doesn't exist on Windows,
  • moreover, this will only work for Agent 7 installs (as the Agent 6 and Agent 7 releases are published on the same repository).

@joeriharleman
Copy link

We're using Ansible to automatically update Datadog, and we'd like to do this rather frequently. However, due to the fact that this Ansible role always downloads the installer, the process can take extremely long. This doesn't scale to multiple servers very well, so it'd be nice to see an improvement.

Any chance of this issue being resolved?

@albertvaka
Copy link
Contributor

Hi Joeri! Your concern is valid and it is something we should fix, but that we haven't prioritized yet. I'll bump it internally. Note, though, that not pinning a version is not the recommended configuration of the role. If you pin a specific version of the Agent to install (and update it manually when you think it is convenient) then it won't download the MSI again on each run. Also, pinning ensures that you won't get updates at a time when you don't want them, which is the main reason we recommend it.

@grizzlyhazard
Copy link

grizzlyhazard commented Aug 11, 2022

Agreed, more idempotency in this role, please.

@bkabrda
Copy link
Contributor

bkabrda commented Aug 15, 2022

@grizzlyhazard hi 👋 do you have any other issues specifically other than the one reported in the root comment here? If so, I'd definitely like to know what they are - feel free to open more issues or note them here. Thanks!

@diederich
Copy link

Thanks for looking into this! 🙏 And +1 on somehow allowing to run the role, even with "latest", and not reinstalling on each run.
We're also running a playbook daily, and while we want to pick up updates by default for now, not re-installing in case it hasn't would be wonderful.

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

No branches or pull requests

7 participants