unsupported parameter for ios_l2_interfaces

Hello All
I am getting unsupported parameter for ios_l2_interfaces error when I am trying to run a simple playbook to change VLAN on an interface . I’ve attached my playbook , inventory and anssible.cfg plus -vvv result . other gather fact playbooks would run fine but not this one .

it is much appreciate if anyone can help me fix this.

Hi,

Can you please check the collection version that you are using?
I tried reproducing the same on my end. And it works fine for me.

Regards,
Sagar Paul

Hi Sagar
Thanks for your prompt reply , the test I have conducted was on Switch Cisco 2960X when I change the host to a Cisco 9200 switch it surprisingly works

and I am confused now , how would different switch types give me different results ?

Hi Hossein,

Would you be able to help me with the collection version you are using and the cisco ios version that both the devices have? Note the currently supported version of the collection is 15.6.x we are planning to upgrade to 17.4.x soon.

Regards,
Sagar Paul

Hi PAul

Sure , here is the 9200 version

Cisco IOS XE Software, Version 17.03.04b
Cisco IOS Software [Amsterdam], Catalyst L3 Switch Software (CAT9K_LITE_IOSXE),

and here is the 2960X version
Cisco IOS Software, C2960X Software (C2960X-UNIVERSALK9-M), Version 15.2(7)E5

I’m abit new to ansible where can I find the Collector version ?

Hi Hossein,

Thanks for sharing the details.
You may use “ansible-galaxy collection list .” to figure out the collection version you are using.
You may raise an issue here for me to track it better.

Regards,
Sagar Paul

Hello

I’m using ansible 2.9 and this command does not work on this version

I think I need to upgrade it to 2.10

Hi Hossein,

So the issue you shared, doesn’t really have to do anything with the ansible-core version being used,
would you be able to share the output of ansible-galaxy collection list cisco.ios
That would help me triage your issue better.

Regards,
Sagar Paul

Hi Paul

I am using bellow python and ansible versions

python version = 2.7.5
ansible 2.9.27

it looks like with the current setup ansible-galaxy collection command does not work for me please see below

[root@ansiblecontroller ~]# ansible-galaxy collection list cisco.ios
usage: ansible-galaxy collection [-h] COLLECTION_ACTION …
ansible-galaxy collection: error: argument COLLECTION_ACTION: invalid choice: u’list’ (choose from ‘init’, ‘build’, ‘publish’, ‘install’)

I have run into this issue before.

It has to do with how the module gets information from the show run

It is checking info by running:

Show running-configuration | section interface GigabitEthernet 2/0/25

My guess is if you run the command on the 2960 it will fail.