Skip to content

Commit 557c34f

Browse files
committed
Update README and CHANGELOG
1 parent 685b45a commit 557c34f

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CHANGELOG
44
# 2.2.0 / 2017-12-27
55
- [FEATURE] Set log level to warning for the datadog and request packages. See [#24][] (thanks to @n0ts)
66
- [FEATURE] Allow users to set a custom location for the configuration file.
7+
- [FEATURE] Added environment variables for configuring datadog api key. See [#22][] (thanks to @pyconsult)
78

89
# 2.1.0 / 2017-12-26
910
- [FEATURE] Disable callback if required python packages aren't installed. See [#28][] (thanks to @dobber)

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,16 @@ Once the required libraries (see above) have been installed on the server:
2121
1. Copy `datadog_callback.py` to your playbook callback directory (by default
2222
`callback_plugins/` in your playbook's root directory). Create the directory
2323
if it doesn't exist.
24-
2. Create a `datadog_callback.yml` file alongside `datadog_callback.py`,
24+
2. You have 3 ways to set your API key. The callback will first use the
25+
environment variable, then the configuration file, then hostvars/vault.
26+
27+
##### Using environment variable
28+
29+
Set the environment variable `DATADOG_API_KEY`.
30+
31+
##### Using a yaml file
32+
33+
Create a `datadog_callback.yml` file alongside `datadog_callback.py`,
2534
and set its contents with your [API key](https://app.datadoghq.com/account/settings#api),
2635
as following:
2736

@@ -37,6 +46,8 @@ For exemple:
3746
ANSIBLE_DATADOG_CALLBACK_CONF_FILE=/etc/datadog/callback_conf.yaml ansible-playbook ...
3847
```
3948

49+
##### Using ansible hostvars and vault
50+
4051
Alternatively you can use the hostvars of the host ansible is being run from (preferably in the vault file):
4152
```
4253
datadog_api_key: <your-api-key>

0 commit comments

Comments
 (0)