The DRY principle: Ansible and variables

One of the frequent teachings I have learned whilst learning programming languages is that repeated blocks of code should be, where possible, placed into a function so that the function can be called multiple times instead of writing out the code multiple times. This approach as the benefits of: Producing repeatable results Reducing the chances … Continue reading The DRY principle: Ansible and variables

Changing Ansible Playbook Depending On Operating System (Ansible)

Ansible's when command

When running an Ansible playbook (or roles) it becomes a little bit irksome to have to create new playbooks just because a device may have a different operating system. Thankfully the awesome people behind Ansible have a solution for this. A Little Background… I have my inventory set in a file called “inventory” in the … Continue reading Changing Ansible Playbook Depending On Operating System (Ansible)

Using Ansible with AWS – Creating Multiple EC2 Instances, Tagging Them and ELK (AWS/Ansible)

An Ansible playbook to create multiple AWS EC2 instances

In my previous blog post I used Ansible to create an AWS EC2 instance and discussed how to do this via the Ansible ec2 module. Today I am going to go slightly more in depth with creating multiple instances, inventory groups and tagging. The playbook I am using for this section is “create_multiple_ec2_instances.yml” and can … Continue reading Using Ansible with AWS – Creating Multiple EC2 Instances, Tagging Them and ELK (AWS/Ansible)

Grafana, Prometheus and Node Exporter On Raspberry Pi via Ansible (Raspberry Pi and Linux)

Node Exporter dashboard showing system metrics

If you want to see metrics in real time and look at web dashboards then Grafana and Prometheus may be the tools you are looking for, and if you are anything like me then you probably want to automate as much of the install as possible via Ansible. My Set Up For this blog post … Continue reading Grafana, Prometheus and Node Exporter On Raspberry Pi via Ansible (Raspberry Pi and Linux)

Installing And Configuring NGINX As A Reverse Proxy Via An Ansible Playbook

NGINX Ansible Playbook on GitHub

Today I am looking at installing and configuring NGINX with an Ansible playbook. In my previous blog posts I have looked at using an Ansible playbook to install the ELK (Elasticsearch, Logstash, Kibana) stack across three different computers, and then how Ansible roles can be used to organise a playbook. Note: The files for this … Continue reading Installing And Configuring NGINX As A Reverse Proxy Via An Ansible Playbook

Using Ansible Roles, aka ELK Stack Ansible Playbook (V2)

The ELK_Ansible_Playbook on GitHub

I have a working Ansible Playbook that installs the ELK stack (Elasticsearch, Logstash, Kibana and for this example, Filebeat) across three different computers. I have tested the playbook several times and it works each time which is a great sign, however the playbook itself is a little messy. Note: All the files for my ELK … Continue reading Using Ansible Roles, aka ELK Stack Ansible Playbook (V2)