O'Reilly logo

OpenStack Administration with Ansible 2 - Second Edition by Walter Bentley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reviewing playbook and role

Let's jump right into examining the roles we created.

The completed role and file named main.yml located in the snmp-config/tasks directory looks 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 config file template: src=snmpd.conf dest=/etc/snmp/snmpd.conf name: Update SNMP options shell: chdir=/bin sed -i 's+^SNMPDOPTS.*+SNMPDOPTS="-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf"+' /etc/default/snmpd name: Stop SNMP service command: service snmpd stop name: Start SNMP service command: service snmpd start name: Set SNMP service ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required