IComeFromTheNet.

Ansible For the Win

  • Tags: php, ansible,
  • Written on: September 15, 2012


I have arrived at a winner. After deciding to embracing Vagrant to manage my development environments. I trialed both Chef and Puppet and found both frustrating.

After installing vagrant I used a bash provisioner and came up with a few scripts to setup a basic dev environment. I later moved on to trial the industry leaders chef and puppet.

I started with Puppet and arrived at the following:

Pros:

  1. DSL helps ruby beginners like me.
  2. Good tutorial series.

Cons:

  1. Ruby for modules.
  2. No guarantee on the order of executing. No way to easily run apt-get update before other recipes run.
  3. PHP cookbooks lack polish
  4. Needed run a daemon on server.

I later try Chef and found the following:

Pros:

  1. Data-bags great way to manage dev/live settings.
  2. Configuration run line by line always knew the order execution of recepies.
  3. PHP and Pear cookbook.

Cons:

  1. Ruby everywhere, too much.
  2. Documentation at the time not beginner friendly in my opinion.
  3. Needed run a daemon on server.

Ansible to the rescue:

I would later try a new entrant into the configuration management scene called Ansible though still developing and the API changing on each release I believe the features working already justify early adoption.

  1. Uses SSH an not custom crypto.
  2. Write modules in any language they only have to return json.
  3. Internal modules don’t aim for lowest common denominator for example separate packages for APT and Yum.
  4. Playbooks are written in YML execute in sequence.
  5. Fails early unlike both chef and puppet.
  6. No Daemon on production servers.

Like chef and puppet there are plugins for vagrant and both offer cascading variables to manage dev / live environments as it’s early days there are no PHP modules, but I was able to translate my CLI scripts to playbooks easily. I look forward to the projects future and version 1 release.

My effors are available though github.