Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

MANAGING NETWORK DEVICE

CONFIGURATIONS
REVIEW QUESTIONS AND HANDS-ON CHALLENGES

After watching the videos in the Ansible Networking Modules – Managing


Configurations section, try to answer these review questions or create the
required Ansible playbooks.

MANAGING NETWORK DEVICE CONFIGURATIONS


 What are core Ansible modules?
 [R] Which network devices are supported by core Ansible modules?
 What are declarative intent modules? What can they do?
 [R] What are the advantages of declarative intent modules?
 [R] Which network devices can be managed with declarative intent
modules in latest release of Ansible?

DECLARATIVE INTENT MODULES


Given the following data stored in all.yml file:

---
ntp_servers:
- 192.168.0.1
- 192.168.0.2
features: [ ospf, bgp, nxapi ]
vlans:
- { id: "1", name: "default" }
- { id: "100", name: "mgmt", subnet: "172.16.1.0/24"}
- { id: "101", name: "web", subnet: "192.168.201.0/24"}
- { id: "110", name: "db", subnet: "192.168.202.0/24"}

Write Ansible playbook that:

 [R] Adds a set of NTP servers specified in all.yml file to all managed NX-
OS devices;
 [R] Gets the list of NTP servers from managed NX-OS devices and
removes extraneous servers;
 Enables specified NX-OS features and reports which of them were already
enabled;

© Copyright ipSpace.net 2017 Page 1

This material is copyrighted and licensed for the sole use by Mikel Maeso (mikel.maeso@gmail.com [85.87.178.33]). More information at http://www.ipSpace.net/Webinars
 Configures a set of VLANs on a NX-OS device and reports all configuration
commands that were executed;
 Gets the list of existing VLANs on a NX-OS device and using the VLAN list
in all.yml file report which VLANs are missing from the device without
using map or selectattr Jinja2 filters.
 [R] For all VLAN interfaces configured on a Nexus switch where IP address
ends with .1 change the IP address to .2 and configure HSRP with HSRP
address .1

Use the new declarative intent modules available in Ansible 2.2 and 2.3 when
writing the above playbooks.

GENERIC CONFIGURATION CHANGES


Given the following data stored in all.yml file:

---
ntp_servers:
- 192.168.0.1
- 192.168.0.2
snmp:
servers: [ 192.168.0.3, 192.168.0.4 ]
community: public
internal_prefixes:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16

Write Ansible playbook that:

 Configures NTP servers on your managed devices based on a list of NTP


servers specified in all.yml group file.
 Extend the playbook to remove all extraneous NTP servers from the
managed devices
 [R] Extends the playbook to document the changes that would be made to
the device when you use check mode. See
http://docs.ansible.com/ansible/playbooks_checkmode.html for more
details.
 Configures SNMP parameters using platform-specific templates, not
multiple Ansible tasks.
 Gets the list of BGP neighbors configured on a router and put all of them
into shutdown state.
 Creates a prefix list permitting all internal_prefixes specified in all.yml
group file on all managed devices

© Copyright ipSpace.net 2017 Page 2

This material is copyrighted and licensed for the sole use by Mikel Maeso (mikel.maeso@gmail.com [85.87.178.33]). More information at http://www.ipSpace.net/Webinars
DEPLOYING CONFIGURATION FILES
Write Ansible playbook that:

 Given list of edge and transit interfaces (for example, in host variables
file) creates OSPF configuration for the device and deploys it.

Extend the playbook to:

 support multiple platforms


 verify all specified configuration commands were successfully executed
and appear in router configuration
 [R] identify the device type (and corresponding template to use)
dynamically without specifying it in Ansible inventory or variable files
 [R] report changes that would be made when run in check mode (use
http://docs.ansible.com/ansible/playbooks_checkmode.html)
 [R] send an email when the changes are made
 [R] save modified router/switch configuration in a Git repository
 compute and report changes that would be made to the devices in offline
mode using device configuration files saved by the previous playbook.

© Copyright ipSpace.net 2017 Page 3

This material is copyrighted and licensed for the sole use by Mikel Maeso (mikel.maeso@gmail.com [85.87.178.33]). More information at http://www.ipSpace.net/Webinars

You might also like