Dec 222013
 

Over the past few weeks, I worked with two different configuration tools: Salt and Ansible.

I started working with Salt. I quickly created a setup for a Salt server and for a Salt minion. The modules I saw looked great. However, I had consistently had trouble converting from the documentation to a practical usage. The examples provided always seemed to be CLI. Taking that and converting it to a SLS file caused me some frustration.

After creating scripts for configuring Bacula client, logcheck, and nrpe, I started doing the same on Ansible.

I found Ansible easier to work with. There were still some frustrating parts, but now I have the following roles set up:

aliases          bsdstats         joe              munin-node       ntpd             pkgng            smartd           sshd_higher_port
bacula-client    ezjail           logcheck         nrpe             openvpn          postfix          sshd             users-main

The above set of scripts allows me to configure a new jail host entirely from scripting. That said, I did have to install the OS, configure networking, add the ssh user, and configure *some* things manually. But after that, all of the above was configured by script.

I really liked the various modules and tools available in salt, but as mentioned, the examples all seemed to be CLI, but most of what I do would be with SLS, not CLI.

I will be proceeding with Ansible for setting up the rest of this server and I’ll document some of what I’m doing as I go along.

What’s installed?

Here is a minimal Ansible install:

# pkg info
ansible-1.4.1                  Simple ssh-based configuration management and orchestration system
gettext-0.18.3.1               GNU gettext package
gmp-5.1.3                      A free library for arbitrary precision arithmetic
libiconv-1.14_1                A character set conversion library
pkg-1.2.1                      New generation package manager
py27-Babel-1.3_1               Collection of tools for internationalizing Python applications
py27-Jinja2-2.7.1              Fast and easy to use stand-alone template engine
py27-MarkupSafe-0.18           Implements a XML/HTML/XHTML Markup safe string for Python
py27-keyczar-0.71c             Toolkit for safe and simple cryptography
py27-paramiko-1.11.0           Python SSH2 protocol library
py27-pycrypto-2.6.1            The Python Cryptography Toolkit
py27-pytz-2013.8,1             World Timezone Definitions for Python
py27-setuptools-1.1.7_1        Python packages installer
py27-yaml-3.10                 Python YAML parser
python-2.7_1,2                 The \"meta-port\" for the default version of Python interpreter
python2-2_1                    The \"meta-port\" for version 2 of the Python interpreter
python27-2.7.6                 Interpreted object-oriented programming language

Here is a minimal salt install:

# pkg info
gettext-0.18.3.1               GNU gettext package
gmp-5.1.3                      A free library for arbitrary precision arithmetic
libiconv-1.14_1                A character set conversion library
libzmq4-4.0.3                  ZeroMQ core library (Version 4)
pkg-1.2.1                      New generation package manager
py27-Babel-1.3_1               Collection of tools for internationalizing Python applications
py27-Jinja2-2.7.1              Fast and easy to use stand-alone template engine
py27-MarkupSafe-0.18           Implements a XML/HTML/XHTML Markup safe string for Python
py27-m2crypto-0.21.1_1         Crypto and SSL toolkit for Python
py27-msgpack-0.2.2             MessagePack (de)serializer for Python
py27-pycrypto-2.6.1            The Python Cryptography Toolkit
py27-pytz-2013.8,1             World Timezone Definitions for Python
py27-pyzmq-14.0.1              Python bindings for ZeroMQ
py27-salt-0.17.2               Distributed remote execution and configuration management system
py27-setuptools-1.1.7_1        Python packages installer
py27-yaml-3.10                 Python YAML parser
python-2.7_1,2                 The \"meta-port\" for the default version of Python interpreter
python2-2_1                    The \"meta-port\" for version 2 of the Python interpreter
python27-2.7.6                 Interpreted object-oriented programming language
sshpass-1.05                   A non-interactive ssh password auth tool

Ansible installs this, but Salt does not:

  1. py27-keyczar-0.71c
  2. py27-paramiko-1.11.0
  3. Salt installs this, but Ansible does not:

    1. libzmq4-4.0.3
    2. py27-m2crypto-0.21.1_1
    3. py27-msgpack-0.2.2
    4. py27-pyzmq-14.0.1
    5. sshpass-1.05

  3 Responses to “Ansible versus Salt”

  1. I use both Ansible (home) and Salt (work).

    I think you looked at the wrong part of the documentation for salt.

    Here:

    http://docs.saltstack.com/salt-modindex.html

    You click on “s” for the states section.
    I think you went to “m” for the modules which makes sense you would but as you found out its all CLI references.

    Direct link to states

  2. I’ve never seen that page before.

  3. In fact, the documentation appears completed changed.