Nixos vs Ansible

I have used Ansible for the devops of my company, and can confirm what Ryan says:

Here’s a simpler article about the same Divergent, Convergent, Congruent system management concepts. Concretely:

In Ansible, if you declare yourself an Nginx webserver into its YAML files, and deploy, Nginx is running.
If you delete Nginx from the YAML file, and deploy, Nginx is still running.

Thus, Ansible does not actually provide proper declarative system management: There is no guarantee that what you write in your YAML files isn’t actually what’s running on your servers.

Further, even our moderately-sized Ansible playbooks took > 10 minutes to run, because Ansible is just an imperative command runner without a real understanding of what’s happening on the other system, so there is no proper incrementality. To alleviate that, you can try to use conditionals but they are almost impossible to get right, and so you often end up some change that you want deployed being skipped accidentally. We wanted something that will take only a few seconds when, say, changing nginx.conf, and restarting only those things that actually depend on nginx.conf.

In combination, those 2 issues were unacceptable for my company. I thought that there must be a better way, and found nixops, and thus NixOS.

Thus we switched all our servers from Ansible to NixOS + nixops 5 years ago, and are very happy with it. Deploys are now declarative, and small changes apply within seconds.

17 Likes