unsupported parameter for ios_l2_interfaces

268 views
Skip to first unread message

Hossein Malakooti

unread,
Jul 28, 2022, 1:29:47 PM7/28/22
to Ansible Project
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.

----------------------------------------------------------------------------------
Inventory-2.yml

---
all:
   children:
      switches:
         children:
            ios:
             hosts:
              sw-1:
                 ansible_host: 10.200.1.1
             vars:
                ansible_become: yes
                ansible_connection: local
                ansible_become_method: enable
                ansible_user: ncm
                ansible_password: !vault |
                  $ANSIBLE_VAULT;1.2;AES256;userid01                           
----------------------------------------------------------------------------------
Playbook-3.yml:

---
 - name: IOS Config Demo
   hosts: switches

   tasks:
      - name: Configure Access
        ios_l2_interfaces:
          config:
            - name: GigabitEthernet2/0/25
              access:
                vlan: 7
          state: merged
------------------------------------------------------------
ansible.cfg

[defaults]
export ANSIBLE_PARAMIKO_LOOK_FOR_KEYS=false

[persistent_connection]
command_timeout = 60
------------------------------------------------------------
Result:

[user@ansiblecontroller inventory]# ansible-playbook --vault-id user1@prompt playbook-3.yml -i inventory-2.yml -vvv

fatal: [sw-1]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "config": [
                {
                    "access": {
                        "vlan": 7
                    },
                    "name": "GigabitEthernet2/0/25"
                }
            ],
            "provider": {
                "auth_pass": null,
                "authorize": false,
                "host": null,
                "password": null,
                "port": null,
                "ssh_keyfile": null,
                "timeout": null,
                "username": null
            },
            "state": "merged"
        }
    },
    "msg": "Unsupported parameters for (ios_l2_interfaces) module: provider Supported parameters include: config, state"
------------------------------------------------------------

Thank you

Sagar Paul

unread,
Jul 29, 2022, 2:04:28 AM7/29/22
to Ansible Project

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

Hossein Malakooti

unread,
Jul 29, 2022, 11:37:30 AM7/29/22
to ansible...@googlegroups.com
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 ?
Thank you


--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/-Pui8AiMKmA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/bc1dbc3d-8696-4d8d-bd63-18e526614249n%40googlegroups.com.

Sagar Paul

unread,
Jul 30, 2022, 12:43:28 AM7/30/22
to ansible...@googlegroups.com
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

Hossein Malakooti

unread,
Jul 30, 2022, 10:03:16 PM7/30/22
to ansible...@googlegroups.com
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 ?

Regards,






--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/-Pui8AiMKmA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.

Sagar Paul

unread,
Aug 1, 2022, 2:31:35 AM8/1/22
to ansible...@googlegroups.com
Hi Hossein,

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

Regards,
Sagar Paul

You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CABNDS_FxfZknfZQj7NM9PbgXzq0K-%3D3bXN4EuxEzNH-TJFPsgg%40mail.gmail.com.

Hossein Malakooti

unread,
Aug 2, 2022, 9:30:34 AM8/2/22
to ansible...@googlegroups.com
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

Regards,






Sagar Paul

unread,
Aug 2, 2022, 9:46:59 AM8/2/22
to ansible...@googlegroups.com
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

Hossein Malakooti

unread,
Aug 2, 2022, 9:58:52 AM8/2/22
to ansible...@googlegroups.com
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')

Regards,





J C

unread,
Aug 2, 2022, 10:07:31 PM8/2/22
to ansible...@googlegroups.com
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.

Reply all
Reply to author
Forward
0 new messages