Ansible

Ansible Impressions

Ansible thoughtsAfter using Ansible as a personal DevOps tool for a couple of months, here are some impressions.

Context

  • Outside of work (web development) I look after six Drupal 7 and WordPress sites on shared hosting
  • My local development is done on a MacBook using apache (with some dabbling in Lando/Docker). I've done some wildcarding with dnsmasq and vhosts to streamline local dev site configuration. CMS code is in git repos.
  • My Ansible work is a personal project and I'm the only stakeholder
  • I learned Ansible doing this work

Avoid the Changing Ansible Timestamp Gotcha

Tagged:

Ansible variables are evaluated each time they're used. This means the following playbook vars declaration will always return the current time where ever it's used in the playbook!:

vars:
  timestamp: "{{ lookup('pipe', 'date +%Y-%m-%d-%H%M') }}"

This is not the desired situation if the timestamp is used as part of a filename. For example: filename: "backup-{{timestamp}}.sql".

Fortunately, there's an easy solution.

Ansible Starter Setup

Ansible LogoAnsible is an open source IT automation tool. I tend to describe it as a task-runner with a host database (which Ansible calls the inventory). A big selling point is no agent software is needed on managed remote hosts. Details at the Ansible website: https://www.ansible.com/use-cases

tl;dr: If you're just beginning with Ansible this might help: https://github.com/dale42/ansible-starter

Subscribe to RSS - Ansible