(no title)
bryogenic | 5 years ago
Systems administration and automation is complex.
That being said I've found Ansible to be the most useful tool for the job. It does the things I need it to and new modules are usually easy to incorporate into my work if I need specific tasks done. It has its shortcomings but it hasn't blown up into an unmaintainable mess like many of the other solutions I've poured hundreds of hours into.
YAML is not fun, but it's been good enough for the task of pushing parameters around.
PowerBar|5 years ago
Recently I had a use-case where I wanted to re-use some data from a defined variable (list of objects) in a second module, but the format had to be different. In python I would have done something like new_var=[{a:i['a'], b:i['b']} for i in old_var], but apparently that is impossible in ansible. The best solution I was able to find after lots of searching was to to pass new_var to a jinja2 template which would render new_var as text, then run that through a json interpreter and set that as new_var. Absolutely rediculous.
It astounds me that a tool BUILT on python lacks any semblance of python's biggest feature, list comprehension.
bryogenic|5 years ago
But "writing" Ansible playbooks is definitely not python. It's its own dsl bastardized between yaml, jinja2 and reserved/special keywords. This is the worst thing I can say about the whole toolkit.
Unfortunately, I'm really productive with it and when I return to work I've written 3+ years ago:
A) It still runs
2) I can read and understand the intent of my playbooks
dnautics|5 years ago
geerlingguy|5 years ago
The hardest thing for some people seems to be whitespace issues, but that can be resolved easily enough by integrating a linter into your environment, or minimally showing whitespace characters in your editor.