Recent posts

Ansible Installation

April 18, 2017

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

Ansible Conditionals

April 18, 2017

Inline expressions Reference: Inline ‘if’ expressions It’s possible to use inline if-expressions: {{ 'Update' if files else 'Continue' }} Note: See the Jinja2 Filters section for more information. ‘if/else’ example Reference: cidr block’s git repo "{{ 'unknown' if ssh_output|failed else ssh_output['stdout'][0]|determine_os}}" Note: Se...

Ansible Built-in Variables

April 18, 2017

Ansible has built in variables which you can come in handy with some Playbooks. They can be viewed using the following Ad-Hoc command: ansible all -i, -m debug -a "msg=" or this Task: --- - name: Display vars debug: msg= Note that the latter provides much more information than the former. When the above Task is run, one of...

Ansible Ad-Hoc Commands

April 18, 2017

As per the Ansible documentation: An ad-hoc command is something that you might type in to do something really quick, but don’t want to save for later. For example, if you want to you can test a module, (e.g IOS_Facts), without having to write a Playbook by using Ad-Hoc commands such as this: ansible all -i, -c local -m ios_fact...

Use Ansible Tags to Organise your Plays & Tasks

April 14, 2017

The Ansible tag documentation does a great job of explaining tags, tag re-used and tag inheritance.  However, I’d like to dive a little deeper to show you just how useful they can be. To get the most out of this post you’ll need to be familiar with the ways in which you can structure your Playbooks. If you don’t know how they can be structured,...