Skip to content

Conversation

@ShawnHardwick
Copy link

@ShawnHardwick ShawnHardwick commented Jan 27, 2025

Issue occurs on Ansible 2.16 and Ansible 2.18 against RHEL 8 target hosts.

I use molecule to perform idempotence tests against our Ansible code and found that version 5.8.0 of the datadog.dd collection fails idempotence tests against our RHEL 8 instances.

[2025-01-27T17:28:02.248Z] CRITICAL Idempotence test failed because of the following tasks:
[2025-01-27T17:28:02.248Z] *  => datadog.dd.agent : Install Datadog Agent 7 yum repo
[2025-01-27T17:28:02.248Z] *  => datadog.dd.agent : Clean repo metadata if repo changed
[2025-01-27T17:28:02.248Z] *  => datadog.dd.agent : Refresh Datadog repository cache

Running molecule in diff mode returns that the includepkgs line is being modified:

TASK [datadog.dd.agent : Install Datadog Agent 7 yum repo] *********************
--- before: /etc/yum.repos.d/datadog.repo
+++ after: /etc/yum.repos.d/datadog.repo
@@ -6,7 +6,7 @@
 https://s3.amazonaws.com/public-signing-keys/DATADOG_RPM_KEY_B01082D3.public
 https://s3.amazonaws.com/public-signing-keys/DATADOG_RPM_KEY_FD4BF915.public
 https://s3.amazonaws.com/public-signing-keys/DATADOG_RPM_KEY_E09422B3.public
-includepkgs = datadog-agent-7.53.0-1 datadog-apm-inject
+includepkgs = datadog-agent-7.53.0-1 datadog-apm-inject 
 name = Datadog, Inc.
 repo_gpgcheck = 1

Checking the fact that determines the value for this shows a whitespace at the end of the value that is causing the task to fail idempotence:
agent_datadog_includepkgs: 'datadog-agent-7.53.0-1 datadog-apm-inject '

Ideally, the Datadog role should be passing each includepkg as a list and not a white-space seperate string even though the documentation supports this format. Also this might be an oversight in how the yum_repository task checks for changes in Ansible, but that is outside the scope of this role.

This behavior was only introduced in 5.8.0 with the change to how the role handles agent install skipping with this change. Previously in 5.7.0, it would install the agent and configure the repository. During the idempotence check, the agent would be installed and skip managing the YUM repo.

@ShawnHardwick ShawnHardwick requested review from a team as code owners January 27, 2025 20:54
@swang392
Copy link
Contributor

Hi @ShawnHardwick the mac install errors are not related to your changes -- could you rebase your branch to resolve the errors?

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.

2 participants