Comments (3)
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:
defaults/main.yml
- Public variables that you expect people to overwrite (aka. defaults)vars/main.yml
- Private variables that you use in your tasks but don't want people messing with
Are you using default variables in a different way?
from ansigenome.
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.
from ansigenome.
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 defaults/main.yml
when you "rebuild" a role. It is expected that you comment the variables there so you have a single point of truth for both defining and documenting your default variables. If you have defaults set in the template then there's no way to really comment them in a sane way.
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.
from ansigenome.
Related Issues (20)
- Python 3 incompatibility HOT 8
- Ansigenome missed one instance of a internal variable.
- Roles don't connect to one another HOT 2
- 86a62d40adac956784510ec11fe8ee197a9f05c8 broke `role.galaxy_name` HOT 4
- Support Ansible custom filters
- errors when handling missing meta/main.yml HOT 4
- Scan does not detect markdown readmes HOT 2
- variables graph
- can we have multiple authors? HOT 1
- cuts the first letters from beginning of the name in gendoc HOT 1
- parser fails due to "Too many levels of symbolic links" HOT 1
- Breaks with inline vault-encrypted variables HOT 1
- Add ability to ignore role's subfolders
- ansigenome not installing properly HOT 2
- Exported png doesn't seem valid HOT 3
- question: had anyone automated ansigenome? HOT 2
- location / config for custom meta templates
- allow include templates from url
- ansigenome 0.6.0 ignores the ansigenome.yml
- template not found error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansigenome.