Coding the playbooks and roles
In this section, we will now use all of that Ansible magic to create a series of playbooks and roles to set up Nagios to monitor your OpenStack cloud. Once completed, you will have a fully functioning Nagios installation that will be customized to monitor OpenStack with some of the monitoring checks we reviewed in the previous section. This time around we broken up the tasks into eight roles in order to keep things simple. Let's review each role in the later .
snmp-config
The first role we will create will include those tasks needed to set up the foundation for collecting the monitoring data. The name of the file will be main.yml
located within the role
directory named snmp-config/tasks
. The contents of this file will look like this:
--- name: Install additional packages apt: name="{{ item }}" state=present with_items: - snmpd name: Move standard config command: mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.org name: Place new...