Hacker News new | ask | show | jobs
by est 4087 days ago
OK I am gonna ask the obvious question here: How does Ansible compare to Saltstack?
2 comments

My own experience, which is fairly limited, is that Ansible is much simpler, "agent-less" (it uploads code as needed and remote executes it over SSH) and a mix between declarative and imperative in nature (a lot of the modules require you to use semaphore files or equivalent for idempotence.) Orchestration is pretty much built-in, including rolling deployment/restarts. Performance can be lacking on large cluster due to the many network round trips and lack of agent. Agents can be faked by rsync'ing config and running ansible in local mode. You can use ansible to do it and ansible is a great Fabric replacement.

Salt is much heavier to setup. Has explicit agents ("minions") and a server ("Salt master") whereas ansible can be run from anywhere as long as SSH connection exists. Salt maintains metadata ("grains") about the remote hosts, ansible gathers whatever data it needs on demand. Salt is heavy on the custom terminology and concepts. You have to work with the metaphors. Salt states are much more declarative.

Both make use of YAML for a lot of things.

My impression was that Ansible is a far better tool for smaller environments with, say, less then 20-50 hosts being managed and the learning curve is surprisingly shallow. When I got it to work, I had more difficulty getting Vagrant to like Ansible than Ansible to setup a complicated stack (Islandora for the curious.) The semi declarative nature of the Ansible modules was easy to work with but getting idempotence was actually a bit of a pain.

I've not fully setup Salt because of the level of effort required. It's comparable to a full Chef setup.

Salt has an agent-less option as well.
Indeed it does. Salt-SSH: http://docs.saltstack.com/en/latest/topics/ssh/

It was recently declared production-ready, but it isn't intended to be an alternative to the standard Salt fileserver. Seems like it's more of an easy way to bootstrap machines.

Ansible is much easier to get into. The more complex your requirements are (complexity of your infrastructure, services, etc) the less useful it becomes IMHO. SaltStack feels much more feature-complete and much more powerful to me. Also Ansible has no dependency-graph which sometimes makes it hard to modularize your "plays". On the other hand, SaltStack needs to be setup on the minions first, whereas with Ansible you only need SSH. I myself now use Ansible to bootstrap SaltStack and let SaltStack do the heavy lifting.