Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message when target is not defined #63

Open
Julien4218 opened this issue Sep 28, 2023 · 0 comments
Open

Improve error message when target is not defined #63

Julien4218 opened this issue Sep 28, 2023 · 0 comments
Labels
enhancement Feature Improvements

Comments

@Julien4218
Copy link

When providing a list of target, if one of the value is incorrect, it would be great to get back a user message with all the possible values to use, source https://github.com/newrelic/ansible-install/blob/main/defaults/main.yml$L4

Desired Behavior

Instead of

TASK [newrelic.newrelic_install : Validate targets] *******************************************************************************************************************
failed: [1.2.3.4] (item=infa) => {"ansible_loop_var": "item", "assertion": "target_name_map[item] is defined", "changed": false, "evaluated_to": false, "item": "infa", "msg": "Assertion failed"}

It should say something like

TASK [newrelic.newrelic_install : Assert target values are defined] *******************************************************************************
failed: [1.2.3.4] => {
    "changed": false,
    "msg": "undefined target value of infa. target should be one of: infrastructure, logs, apm..."
}
@Julien4218 Julien4218 added the enhancement Feature Improvements label Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature Improvements
Projects
None yet
Development

No branches or pull requests

1 participant