DataDog / ansible-datadog

Ansible role for Datadog Agent
Apache License 2.0
298 stars 222 forks source link

Datadog APM does not work with Ansible 2.9 #518

Open willwen opened 11 months ago

willwen commented 11 months ago

The Readme says ansible 2.6+ works with this datadog role. https://github.com/DataDog/ansible-datadog/blob/main/README.md?plain=1#L20

If you use 2.9, and try to do apm instrumentation, the argument list_merge here https://github.com/DataDog/ansible-datadog/blob/a6e34170dcbc003867198f783084988c29a9ef4a/tasks/apm-inject-check.yml#L73 was only introduced in ansible 2.10 https://github.com/ansible-community/ansible-build-data/blob/main/2.10/CHANGELOG-v2.10.rst#L4186

The error you will get is:

TASK [datadog.dd.agent : Update datadog_config including config values needed for APM host injection] ****************************
task path: /home/test_user/.ansible/collections/ansible_collections/datadog/dd/roles/agent/tasks/apm-inject-check.yml:71
fatal: [FOOBAR]: FAILED! => {
    "msg": "'recursive' is the only valid keyword argument"
}

Solution for me was to upgrade ansible

bkabrda commented 6 months ago

Hi :wave: thanks for the issue report. You're absolutely right that this won't work on Ansible < 2.10. Unfortunately maintaining compatibility with these EOLed Ansible versions is becoming harder and harder and causes problems such as this one. I'm glad that you could upgrade and that fixes it for you. I'll leave this issue open for now and I'd encourage anyone with the same issue (who can't upgrade) to let us know here - that will help us gauge the urgency of fixing this.

aairey commented 4 months ago

This role needs a major (breaking) update to drop support for the unsupported ansible versions and support the newer ones fully. Like embracing FQCN. I am getting failures on Ansible 2.16.5, which is a supported version.