Install the Datadog Ansible callback integration to:
For more information about using Datadog integrations with Ansible, read the blog post Ansible + Datadog: Monitor your automation, automate your monitoring.
Ensure the prerequisite Python libraries are installed on the server:
pip install pyyaml
)pip install pyopenssl idna
Clone the ansible-datadog-callback GitHub repo.
Copy datadog_callback.py
to your playbook callback directory (by default callback_plugins/ in your playbook’s root directory). Create the directory if it doesn’t exist.
Create a datadog_callback.yml
file alongside datadog_callback.py
, and set its contents with your API key, as following:
api_key: <YOUR_DATADOG_API_KEY>
Ansible events and metrics appear in Datadog after your playbook is run.
To install the Datadog Agent using Ansible, refer to the installation documentation here.
Refer to the playbook example to learn how to install the Datadog Agent with Log collection enabled using Ansible.
ansible.elapsed_time (gauge) | Time taken to execute a playbook Shown as second |
ansible.task.ok (gauge) | Number of tasks that did not require any change Shown as task |
ansible.task.failures (gauge) | Number of tasks that failed Shown as task |
ansible.task.skipped (gauge) | Number of tasks that got skipped Shown as task |
ansible.task.unreachable (gauge) | Number of tasks for which nodes were unreachable Shown as task |
ansible.task.changed (gauge) | Number of tasks that successfully applied changes Shown as task |
The ansible-datadog-callback captures Ansible events from your playbook runs.
The Ansible integration does not include any service checks.
Need help? Contact Datadog support.