Open Shemeikka opened 7 years ago
Thanks. This is definitely a good idea.
At this point supporting pointing to a variables file from the CLI might be more feasible than an import
keyword since we will be soon in the process of reinforcing/improving our template language.
Note that this external import file might be more scalable and help our current config template defaults (view them with awless config
). Currently, you can actually set any value in config that will be used as default in templates:
awless config set topic.name mytopicname
(will be used each time in the awless create topic for the name)
But indeed those persisted defaults might not be obvious (you have to prepend the entity name) and are different from dynamic env variables.
We want to do that properly so we will discuss about that and see where we want to take it @fxaguessy @hbbio
In the meantime, a --import-vars
flag when running template could help I think without breaking anything and while making clear that we only import variables (instead of putting them at the top of each file).
@Shemeikka we try to focus awless
on real life usage (as we do here internally). It would be great if you had a look at this short Google form https://goo.gl/forms/1lQFPEIxdt37aDn43
Cheers.
Idea: Allow importing template variables from another file(s).
Use case: Allows supporting multiple environments (i.e. dev, test, etc.) Better automation support.
Example:
Importing could be done either using cli argument
or inside the actual file
This would be extremely useful for e.q. setting instance counts per environment.