This repository is deprecated; please follow the main search page or use the ‘Related code repos’ widget on the right side of the current page.

Trunk Port Audit

This ansible playbook 'shutdown-trunk-ports' has been created to audit and disable all unused/inactive trunk ports on Cisco network access switches within a network.

Objective

It gathers interface facts and verifies all interfaces with the status 'down'

It also matches on interfaces that have been configured with a description 'uplink', this can be removed or changed to something else.

There are many more interface values that can be matched on the conditional 'when' rule within the playbook.

Requirements

To use this playbook you will need:

  • Ansible 2.6+ installed on a Linux box
  • SSH client
  • Git installed on Linux

Install and Setup

  1. Logon to your Linux box
  2. Execute the following to download playbook "git clone https://github.com/networkn00b/network-tasks.git"
  3. cd ~/git/networkn00b
  4. Move yaml files into folder containing your ansible installation
  5. Update hosts file, under mysite include hostnames/IPs of devices being targetted
  6. Update network_cli with credentials to access devices
  7. If required, Update shutdown-trunk-ports.yml file with description of interfaces being targetted
  8. Execute playbook "ansible-playbook shutdown-trunk-ports.yml -C -V" to check config of playbook and expected result
  9. Execute playbook without check mode to proceed to disable interfaces "ansible-playbook shutdown-trunk-ports.yml"
View code on GitHub
  • Owner

  • Contributors

    +1Github contributor
  • Categories

  • Programming Languages

  • License

    MIT License

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.