-
Notifications
You must be signed in to change notification settings - Fork 64
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
check template for defaults #1
Comments
When you wrote "check templates for defaults" as the title, did you mean check the vars folder? I might be off base but I see it like this:
Are you using default variables in a different way? |
I have the defaults for standard options within the playbook but within templates I have options such as {{directory|default('/var/www')}}, the option of having them within the defaults/main file may be better however I noticed that a few roles that I have seen have used the same method as myself. |
Ok, I fully understand what you mean now. I have witnessed that pattern before too. A lot of people put |default() in their template and if it's not overwritten in the user's inventory somewhere then it's undefined which means the default value in the template will be used. I see 2 potential issues with scraping the templates directory. The biggest issue is that right now the readme's defaults get taken as is from your The other issue might be some ambiguity between what is expected as a default role value and what you defined locally in the template or what's being passed in from a task. I do think your suggestion is worth exploring though. It should be able to detect template defaults but we need to come up with a reasonable way of generating documentation from it and removing any chance of ambiguity. |
I noticed when running this it did not report any defaults for my role however there are a number of defaults outside of the standard tasks folder
The text was updated successfully, but these errors were encountered: