Working With JSON in Ansible
17/03/2019
Reading JSON in Ansible is easy. Here are some examples…
17/03/2019
Reading JSON in Ansible is easy. Here are some examples…
23/02/2019
Today I spent a good few hours trying to get the Geerling Guy AWX role to work. AWX is the open source, free version of Ansible Tower. Suffice to say, the combination of dependencies is sufficiently broken to be (currently) useless. Here’s the fix…
29/09/2018
12/09/2018
Host groups are a powerful concept in Dynatrace. This tutorial shows how to utilise host groupings to properly define and baseline a set of Apache services.
First, let’s describe the basic architecture of what we’re deploying. Assume we have a set of hosts all running Apache HTTPD processes. These hosts serve 3 distinct functions within our estate:
Logically, we need to separate these hosts by their function – we don’t want Dynatrace to group them all together. More crucially, we want Dynatrace to baseline and alert on them seperately.
The official documentation is great, so I’m not going to repeat things, aside from a few keys points:
Host groups are defined when the OneAgent is installed. Hosts can only be a member of a single host group. Host groups form the boundary for process groups and services.
Host groups are optional but should be considered necessary for an optimal deployment. Utilising host groups should be considered a best practice.
Due to the way Dynatrace creates process groups. By default, Dynatrace will see that the hosts are all running Apache HTTPD servers and thus logically group them into a single process group.
We can use the 3rd fact above to split these hosts into different process groups, based on their host group.
Spin up 3x VMs and install the latest Apache httpd
on them:
sudo yum install httpd24 php72 -y
Do not start the Apache process yet!
I’m assuming you have a Dynatrace environment. If not, get a free 15 day trial here.
Install the Dynatrace OneAgent but be sure to append the --set-host-group=inbound-proxy
to your shell script installation.
sudo /bin/sh Dynatrace-OneAgent...sh APP_LOG_CONTENT_ACCESS=1 --set-host-group=inbound-proxy
Repeat for your outbound proxy server, appending --set-host-group=outbound-proxy
sudo /bin/sh Dynatrace-OneAgent...sh APP_LOG_CONTENT_ACCESS=1 --set-host-group=outbound-proxy
Finally for your reverse proxy server, appending --set-host-group=reverse-proxy
sudo /bin/sh Dynatrace-OneAgent...sh APP_LOG_CONTENT_ACCESS=1 --set-host-group=reverse-proxy
Due to the host groups, once the Apache processes are started, you will have 3 distinct groups. However they’ll all be called the same default name.
Make things easy for yourself and append the host group name to the process group. You’ll be able to instantly tell which set of processes is having issues.
Do this via a process group naming rule:
Start your apache processes on each box. You’ll see that you have 3 distinct process groups:
As already mentioned, host groups are extremely powerful and this use case is just one example. Stay tuned for more use cases…
18/08/2018
Ansible Vault is an out-of-the-box encryption mechanism. Use it to store (encrypted) sensitive data for use within playbooks. This tutorial will get you up-and-running with Ansible Vault in under 10 minutes.
09/07/2018
In the previous tutorial we covered Ansible setup and some basic ad-hoc commands. It’s time to get organised and introduce the ability to easily repeat ourselves consistently. This tutorial will focus on playbooks…