Umarudeen
Home / Case studies / Case 05
Case study 05 · Automation

The switch that refused to speak Ansible

In progressPersonal lab3 min read

The short version

The standard Ansible IOS modules failed against a Cisco Small Business switch. Sending raw CLI with ansible.netcommon.cli_command works, and VLAN creation and port assignment across 24 ports is now configured from code.

Overview

A personal lab: a physical Cisco Small Business switch on my home lab network, configured from an Ansible project instead of by hand.

Problem statement

The standard Ansible IOS modules failed against this switch.

Investigation

  1. Compared the switch's CLI behavior with what the IOS modules expect.
  2. Found this firmware's CLI is not compatible with the standard modules.
  3. Switched to ansible.netcommon.cli_command and sent raw CLI instead.

Findings

  • VLAN names cannot have letters immediately followed by digits.
  • switchport trunk native vlan 10 on its own makes VLAN 10 untagged, with no switchport trunk allowed vlan line needed.

Status

VLAN creation and port assignment across 24 FastEthernet ports work from code. A persistent SSH connection hang is deferred. Next: move connection variables into group_vars/all/connection.yml that references Ansible Vault, fix the hang, and scale the inventory to more devices.

Lessons learned

  • Vendor firmware quirks decide which automation approach works. Test against the real device early.
  • Keep credentials out of plain files from the start.

Skills demonstrated

AnsibleYAMLCisco CLIGitTroubleshooting

Confidentiality: all identifying information, credentials, customer data, internal addresses and proprietary configurations have been removed or replaced with illustrative examples.

↑↓ moveEnter openEsc close