ansible-datadog
ansible-datadog copied to clipboard
Hard fail if api_key is not provided
datadog.conf and datadog.yaml role has below line which sets a invalid default value for api_key. If agent_datadog_config["api_key"] or datadog_api_key vars are not provided then api_key in the datadog has 'youshouldsetthis' which fails to start datadog agent. Setting default here actual installs datadog but fails to start the agent until user notices.
{% if agent_datadog_config["api_key"] is not defined -%}
api_key: {{ datadog_api_key | default('youshouldsetthis') }}
{% endif %}
Its better to hard fail while the role is being executed so that the user will provide necessary mandator variables.
Created PR: https://github.com/DataDog/ansible-datadog/pull/505
For many users this is a breaking change, see https://github.com/DataDog/ansible-datadog/pull/505#issuecomment-1871306366
Fixed by #505.