Fix idempotence issue with yum_repository for RHEL #627
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thedatadog.dd
collection fails idempotence tests against our RHEL 8 instances.Running molecule in diff mode returns that the
includepkgs
line is being modified: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 in5.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.