Execute the Ansible Playbook
-
Running an Ansible Playbook
-
Ansible Navigator

Lets get started
That is the end of of your lab briefing!
Step 1 - Execute the Ansible Playbook
-
Switch to the Terminal tab so you can execute your Ansible Playbook.
-
Execute the playbook using the
ansible-navigator run. Since there is just one task we can use the --mode stdoutansible-navigator run resource.yml --mode stdout
Figure 1. The output will look similar to the following: -
Re-running the playbook will demonstrate the concept of idempotency
ansible-navigator run resource.yml --mode stdout
Figure 2. The output will look similar to the following:As you can see in the output, the first time the playbook ran we saw a status of ok=1 and changed=1. This is due to the SNMP configuration being set on the cisco host.
When the playbook runs a second time, you see an output of ok=1 change=0. This is due to the idempotency of the playbook. This means that even though the playbook was run a 2nd time, the changes have been already set thus there was no need for the playbook to make any changes (changed=0).
Step 2 - Verify SNMP configuration
-
Login to an Cisco switch and verify the current SNMP configuration.
-
From the control node terminal, you can
ssh ciscossh cisco -
Use the command
show snmpto examine the SNMP configuration:show snmpYou will have output similar to the following:Chassis: 99SDJQ9I6WK Location: Durham 0 SNMP packets input 0 Bad SNMP version errors 0 Unknown community name 0 Illegal operation for community name supplied 0 Encoding errors 0 Number of requested variables 0 Number of altered variables 0 Get-request PDUs 0 Get-next PDUs 0 Set-request PDUs 0 Input queue packet drops (Maximum queue size 1000) 0 SNMP packets output 0 Too big errors (Maximum packet size 500) 0 No such name errors 0 Bad values errors 0 General errors 0 Response PDUs 0 Trap PDUs Packets currently in SNMP process input queue: 0 SNMP global trap: disabled SNMP logging: disabled -
Use the
show run | s snmpto examine the SNMP running-confgiuration on the Cisco device:show run | s snmpThe output will be simlar to the following:snmp-server community Durham-community RW acl_uq snmp-server community ChapelHill-community RW acl_uq snmp-server packetsize 500 snmp-server location Durham
As you can see, the resource module configured the Cisco IOS-XE network device with the supplied configuration. There are now two total SNMP communities. -
Exit the router CLI to complete the challenge.
exit