`datadog_agent_version` is not fully pinned on Linux with `apt`
robin-wayve opened this issue · 1 comments
robin-wayve commented
We set a pinned version with datadog_agent_version
. Since the role does not use ansible.builtin.dpkg_selections
to put a hold
on datadog-agent
, hosts can upgrade the datadog-agent
package when new versions become available (via apt upgrade
or similar).
If a host does this, the role can't be applied due to trying to downgrade the package (which is a thing you can enable, but only on ansible-core
2.12+, I think).
Workaround I have used:
- gather package facts
- run
ansible.builtin.dpkg_selections
withselection: deinstall
(un-pin) if the version is newer than the installed version - include the datadog role / install the package
- run
ansible.builtin.dpkg_selections
withselection: hold
(pin) to prevent upgrades
I can provide more details if there's interest in handling this in the role.