4 ms·
The important difference between them is not the syntax they are written in, it is their model for how to configure systems. Ansible is imperative. You give it
by cpitman 6y ago
The important difference between them is not the syntax they are written in, it is their model for how to configure systems.
Ansible is imperative. You give it a list of things to do, and it will do each one, in order, whatever you say.
Puppet is declarative. It runs through your entire script to build a model of how things should be, compares the target system to see how things are different, then uses a combination of implicit and explicit dependencies to order changes and apply them to the machine. Because it is building a model, it is able to detect defects like two different modules trying to configure the same thing two different ways.
The declarative models make it so that doing the right thing is easier then doing the wrong thing (ie, making idempotent configuration is easier then exec'ing out). But the imperative model makes doing everything easier (ie, it doesn't guide me to make idempotent scripts, but makes it super easy to automate any old task list).
That is what makes Ansible easier to adopt, the very low level of mental overhead to understand what it is doing. Conversely, it probably also makes it harder to scale, both because performance is basically single-threaded and synchronous and harder to enforce good standards.
PS I work for Red Hat, but have used both Puppet and Ansible extensively.