This doc explains the nuances of using the Datadog Ansible Integration with Ansible Tower.
In a directory of your choosing, run the following commands:
vagrant init ansible/tower
vagrant up --provider virtualbox
vagrant ssh
Upon SSH'ing into the vagrant you'll be greeted with a MOTD similar to:
Welcome to Ansible Tower!
Log into the web interface here:
https://10.42.0.42/
Username: admin
Password: <redacted>
Open up the URL provided. Enter the username and password provided. You'll then need to fill out a quick form to get a trial license key. The email arrived within ~5 minutes of filling out the form. Upload the key that was sent via email.
- Enable the integration in the Datadog Web UI.
- Following the instructions
install the following on the vagrant (a little extra work is required here because of missing packages
on the vagrant):
curl -o get-pip.py https://bootstrap.pypa.io/get-pip.py
python get-pip.py
sudo pip install datadog
At this juncture, the user could either decide to include
datadog_callback.py
in every playbook in the callback_plugins
directory or they can install it globally for all playbooks
on the Ansible Tower server. The context of this document is to install it globally.
The Ansible Tower documentation
is incorrect (as of v3.1.4
which was latest asof 2017-07-27;
permalink for v3.1.4) as to where the plugin should be installed. The installation directory for
datadog_callback.py,
contrary to the documentation, is actually /usr/lib/python2.7/site-packages/ansible/plugins/callback
.
The following command set will get the Datadog Ansible plugin setup properly:
cd /usr/lib/python2.7/site-packages/ansible/plugins/callback
curl -o datadog_callback.py https://raw.githubusercontent.com/DataDog/ansible-datadog-callback/master/datadog_callback.py
sudo vi datadog_callback.yml
- insert
api_key: <your-api-key>
into this yaml file. Note: must be an API key not an App key
- insert