File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff line change @@ -21,7 +21,16 @@ Once the required libraries (see above) have been installed on the server:
21211 . Copy ` datadog_callback.py ` to your playbook callback directory (by default
2222` callback_plugins/ ` in your playbook's root directory). Create the directory
2323if 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 ` ,
2534and set its contents with your [ API key] ( https://app.datadoghq.com/account/settings#api ) ,
2635as following:
2736
@@ -37,6 +46,8 @@ For exemple:
3746ANSIBLE_DATADOG_CALLBACK_CONF_FILE=/etc/datadog/callback_conf.yaml ansible-playbook ...
3847```
3948
49+ ##### Using ansible hostvars and vault
50+
4051Alternatively you can use the hostvars of the host ansible is being run from (preferably in the vault file):
4152```
4253datadog_api_key: <your-api-key>
You can’t perform that action at this time.
0 commit comments