Today I’m going to walk you through the steps to enable the monitoring of Ansible with Logscape 3, this may become a series of the steps taken to develop an Ansible app, but let’s start with the basics, configuring your Ansible installation to generate logs, and configuring Logscape to ingest those logs.
Fortunately, configuring Ansible to generate logs is an easy task, navigate to your Ansible config, or if you don’t have one, create it. Ansible will look in
- ansible.cfg in the working directory
For its config file, once found open it up, and you’ll want to add the following
Run an Ansible command, and you should see data start to appear in your newly created log file. That’s the hard part done.
Load up your manager, and navigate to the data sources page. We’re going to be creating a new datasource for our Ansible data. In my ansible.cfg I configured my logs to be output to /home/gomoz/ansiblelogs/ so that’s what I’ll be using as my directory. For the file mask, you’ll want whatever mask identifies your ansible log, my ansible log is named ansible.log, so I can just stick with the default *.log. Expiration, Archiving Rules and Host filter are all up to you, for the tag I choose ansible-build. Logscape is now tailing your ansible logs.
Searching your Data
While we’re not doing anything interesting with the data (That’ll be in the next blog post). Logscape is now ingesting your Ansible Logs allowing you to bring to bear all of that analytic power to better understand what is happening in your builds. In the next blog we’ll set up some datatypes, and alerts for when things go wrong.
Thanks for reading.