Recent posts

Ansible Minimum Viable Playbook (MVP)

April 18, 2017 | less than 1 minute read

Reference: Adam’s Tech Blog The Minimum Viable Playbook (MVP) is the shortest, most useful Ansible playbook I have. Whenever I need to write some Ansible code and I’m not entirely sure I’m doing it right (which is often), I implement it first in the MVP so I can test it quickly. Here’s my latest iteration: - hosts: localhost connection: loca...

Ansible match() Test

April 18, 2017 | less than 1 minute read

Reference: Ansible match requires a complete match in the string, while search only requires matching a subset of the string. Example As per the selectattr( )  page, the Jinja equalto( )  Test, as well as the Ansible match( )  and search( )  Tests all work in a similar fashion. Using this dictionary: - hosts: localhost connection: local ...

Ansible Lists & Dicts Overview

April 18, 2017 | less than 1 minute read

Reference: Ansible All members of a list are lines beginning at the same indentation level starting with a -  (a dash and a space): --- # A list of tasty fruits fruits: - Apple - Orange - Strawberry - Mango A dictionary is represented in a simple key: value  form (the colon must be followed by a space): # An employee record ...

Ansible Inventory

April 18, 2017 | 1 minute read

Hostnames Reference: Ansible Variables & Inventory  inventory_hostname  is the name of the hostname as configured in Ansible’s inventory host file. This can be useful for when you don’t want to rely on the discovered hostname ansible_hostname  or for other mysterious reasons. If you have a long FQDN, inventory_hostname_short  also contains...

Ansible Installation

April 18, 2017 | less than 1 minute read

Reference: Ansible To configure the PPA on your machine and install Ansible run these commands: $ sudo apt-get install software-properties-common $ sudo apt-add-repository ppa:ansible/ansible $ sudo apt-get update $ sudo apt-get install ansible