I hate ansible, it's just better than any of the alternatives for different reasons. Luckily we're moving away from needing any of them. Scripting an image build is a lot easier than updating a machine using CI: you start from a blank slate every time, and an out of date script isn't the catastrophe it is with CI since you have the images saved.
Using jinja2 for markup compounded the issue in my opinion, as it has no loops and logic is less than obvious (compared to mako for example).
Still I find its agentless model, the idempotent model, being able to use it on machines where you don't have root access etc... gives it a place that nobody had fulfilled.
This comment makes pretty much no sense at all. Example of a loop in jinja2:
{% for item in ("one", "two", "three") %}
item is {{ item }}
{% endfor %}The logic is pure python minus perhaps setting variables ie:
{% set name = "dorfsmay" %}
{% if name == "dorfsmay" or name.startswith("dorfs") %}
You're spreading FUD about jinja2
{% endif %}Ansible is great stuff, but some of those decisions were quite weird.
isn't a loop?
A dumb declarative language is easier to understand and easier to maintain. It can be used to help maintain a strict separation of concerns.
The smarter you try to make the language, the worse it becomes. Ant & MSBuild AFAIK are basically full programming languages in their own right so there was really no point to them actually being their own language.
Why not? Configurations are collections of items, and among the things Lisp excels at is…lists of atoms.
Take a look at https://github.com/ansible/ansible-examples/tree/master/lamp... (a simple LAMP stack implemented in Ansible).
It uses a .ini-style file to manage lists of hosts, e.g.:
[webservers]
localhost
[dbservers]
bensible
sensible
Why not put that in a list? (hosts
(webservers localhost)
(dbservers bensible sensible))
The Ansible playbooks are YAML lists. There's no particular reason that: ---
# This playbook deploys the whole application stack in this site
- name: apply common configuration to all nodes
hosts: all
remote_user: root
roles:
- common
…
is more readable than: (playbook
"This playbook deploys the whole application stack in this site"
(play
"apply common configuration to all nodes"
(hosts all)
(remote-user root)
(roles common)
…)
or: (playbook '((all '(common) :user root :comment "apply common configuration to all nodes") …)
:comment "This playbook deploys the whole application stack in this site")
In fact, I'd argue that both Lispy representations are much more readable.In a S-expression-based configuration language, one would either embed an S-expression-based programming language, or generate the S-expressions with a programming language which can manipulate S-expressions.
I don't think that it's that easy to get away from needing Turing-completeness in general. No reason you can't still support rollbacks, dependencies and diffs anyway.
Also there's this school of thought that attributes most security problems to people accidentally using Turing-complete languages where they meant to use something less powerful. Consider vulnerability to arbitrary code execution through user input injection, which could be interpreted by your program being a "parser" (so-called "shotgun parser" - it's implicitly distributed throughout your code base) for a Turing-complete superset of what was supposed to be a list of accepted inputs. There are pretty good talks about this line of thought and I personally find it pretty interesting.
But none of this affects the fact that in complicated enough programs, you need "configuration" to be more code than data, which leads people not knowing of Lisp to reinvent a subset of it in XML or JSON or something similar.
Maybe because it can't be easily approached by the iterative development style that is in fashion these days.
Syntactically the problem I run into is that it's got it's own DSL in task definitions, so it can be hard to keep in mind what's YAML and what's the DSL.
Semantically loops and conditions are essential features so I don't have a problem with that. The inheritance could use some clarification, I was hit last year by a regression that remains unresolved.