Ansible - Run A Local Script On Remote Server

Let's imagine you have a script to set up your servers from scratch. In this case, let's call it setup.sh and for now, it will just be a BASH script that updates a debian/ubuntu server and installs git. This will work with any type of script, it doesn't…

Read this article

The Ansible Hosts File

The hosts file categorizes servers into groups for our playbooks. For example, it may be useful to create a group for all of the apt based servers (ubuntu/debian etc), called apt-servers for a playbook that wishes to update apt-based servers. A server can belong to any number of groups…

Read this article

Ubuntu 16.04 - Install Ansible

Native Package System This will install ansible version 2.0.0.2. sudo apt update && sudo apt install ansible -y Install from PPA This will install ansible version 2.1.2.0. sudo apt-get install software-properties-common python-software-properties -y sudo add-apt-repository ppa:ansible/ansible -y sudo apt-get update && sudo apt-get install…

Read this article

Ansible - Use SSH Keys

This content has been moved.…

Read this article

Ansible - Update And Reboot (if required) Amazon Linux Servers

Below is the playbook I use for updating my Amazon Linux servers. This will reboot the servers if they receive an updated kernel. It has to run a custom ssh command because unlike Ubuntu, there is no reboot-required file to indicate a reboot is required. The script is one I…

Read this article

Ansible - Update Debian Based Systems

One of the main reasons to deploy an Ansible server is to update all of your servers whenever there is a critical security update such as the heartbleed bug. Today we will show you how to do precisely that for servers that use apt, such as debian and ubuntu. Hosts…

Read this article

Debian 8 - Install Ansible

The simplest (recommended) installation method is to run: sudo apt-get install ansible -y This will install version 1.7.2. Pip Method Alternatively you can install from source to get version 2.0.0. This was subsequently tested on the 29th of October 2016 and failed, but I'm leaving it…

Read this article