The Datadog Ansible collection, datadog.dd, is the official collection of Ansible-related Datadog content. It contains the Ansible Datadog Role, which can be accessed as datadog.dd.agent, allowing you to install and configure the Datadog Agent and integrations. Agent version 7 is installed by default.
Before using this collection, install it with the Ansible Galaxy command-line tool:
ansible-galaxy collection install datadog.dd
Alternatively, include it in a requirements.yml file and install it with ansible-galaxy collection install -r requirements.yml. Include the following in requirments.yml:
collections:- name:datadog.dd
Note: If you install the collection from Ansible Galaxy, it will not be upgraded automatically when you upgrade the Ansible package.
To upgrade the collection to the latest available version, run the following command:
You can install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). The following syntax shows how to install version 5.0.0:
To deploy the Datadog Agent on hosts, add the Datadog role and your API key to your playbook:
- hosts:serverstasks:- name:Import the Datadog Agent role from the Datadog collectionimport_role:name:datadog.dd.agentvars:datadog_api_key:"<YOUR_DD_API_KEY>"
Note: If you install the collection through the Ansible Automation Hub, OpenSUSE/SLES functionality depends on a community collection community.general. Red Hat Support does not provide support for issues related to community content. Direct all support issues for OpenSUSE/SLES to Datadog Support.
The Datadog Collection is tested on CentOS, Debian, Rocky Linux, OpenSUSE, Windows and macOS. Tests are run with latest ansible-lint version and sanity checks running with Python 3.9 to Python 3.12.