4 ms·
Slightly OT: I have recently done some scripting work on a single machine and used Ansible because it makes it so convenient to parse output, generate config f
by aloer 6y ago
Slightly OT:
I have recently done some scripting work on a single machine and used Ansible because it makes it so convenient to parse output, generate config files etc., mostly shell and jinja2
Is that valid use of Ansible or should I be ashamed and use something else?
- eeZah7Ux 6y agoashamed. Almost every programming language is better than a mashup of yaml and jinja
- sirtaj 6y agoWriting plugins in Python is a great way to reduce the size/scope of yaml you have to write, particularly things like filter and vars plugins. You can then use yaml primarily as a data source rather than a programming language.
- NateEag 6y agoIf the tool met your needs, why worry about shame? If you eventually run into difficulties, sit down and understand why. Once you've understood the cause of your problems, see whether the features you didn't take time to understand can alleviate them.
- chousuke 6y agoAnsible is okay for stuff like that. I very much don't like that it does the YAML-as-a-programming-language thing that's way too popular nowadays but when judiciously used, Ansible can be useful. I really want something like Ansible with a real declarative programming language. Puppet is the closest nowadays to having a sane language, but it has its own issues.