-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Raise a warning when a reserved variable is set #4816
Comments
Classifying this as a bug report so it doesn't get lost in the list. |
+1, this had me stumped for a bit using "environment", and only figured it out after guessing it might be the case. |
Spent several hours figuring out why a variable named +1 from me. |
BTW, is there is a list of all things 'reserved'? Just not to stumble over such cases again... |
not a central one, mostly we have some 'magic' internal vars and then keywords/directives for play, role and task. |
I tried to pass a variable named port from a role definition like this:
The template module didn't like the port variable then like this:
The port variable was undefined till I renamed it to something else... |
@meebey Yep. Very annoying, right? :) |
I just bumped into this as well, exactly as @meeby did. While I understand that the devs have more important things to do with currently more than 1k issues open, is there a list of reserved variables names somewhere, maybe a link to the code? |
if only it where that simple, there are many and defined in different places i added this for the basic objects, but far from a complete list http://docs.ansible.com/ansible/playbooks_directives.html |
thanks @bcoca! |
* Added support for dnos9_config module * Addressed @gundalow comments
* removed unused vars * added warning when using reserved vars fixes #4816 * cleanup
As per a list discussion, it would be nice if a warning was printed if the user tries to set a reserved variable, such as
environment
.The text was updated successfully, but these errors were encountered: