Query related to junipernetworks.junos.junos_interfaces

Hello All,

I am just starting out with working on Ansible. Hence, my query might be very elementary in nature but I cannot seem to get over it. I am trying to basically disable a port on a Juniper switch using the junos_interfaces module. However, I run into an error stating the following- “msg”: “Unsupported parameters for (junos_interfaces) module: provider Supported parameters include: config, running_config, state”

}

This is a new module that got introduced in Ansible 2.9. The new module replaced the existing module- junos_interface (without the s at the end). I can run the playbook using the old module but not the new module. The old module doesn’t need a config parameter, unlike the new one. I’d appreciate any help in understanding how to overcome this error.

Thanks,
Debasmita

Following are my environment details:

bash-5.0# ansible --version

ansible 2.10.2

config file = /project/ansible.cfg

configured module search path = [‘/root/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]

ansible python module location = /usr/lib/python3.8/site-packages/ansible

executable location = /usr/bin/ansible

python version = 3.8.5 (default, Jul 20 2020, 23:11:29) [GCC 9.3.0]

Following is the playbook using the new module:

bash-5.0# cat port-down-new.yml

Hello All,

I am just starting out with working on Ansible. Hence, my query might be very elementary in nature but I cannot seem to get over it. I am trying to basically disable a port on a Juniper switch using the junos_interfaces module. However, I run into an error stating the following- “msg”: “Unsupported parameters for (junos_interfaces) module: provider Supported parameters include: config, running_config, state”

}

This is a new module that got introduced in Ansible 2.9. The new module replaced the existing module- junos_interface (without the s at the end). I can run the playbook using the old module but not the new module. The old module doesn’t need a config parameter, unlike the new one. I’d appreciate any help in understanding how to overcome this error.

Thanks,
Debasmita

Following are my environment details:

bash-5.0# ansible --version

ansible 2.10.2

config file = /project/ansible.cfg

configured module search path = [‘/root/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]

ansible python module location = /usr/lib/python3.8/site-packages/ansible

executable location = /usr/bin/ansible

python version = 3.8.5 (default, Jul 20 2020, 23:11:29) [GCC 9.3.0]

Following is the playbook using the new module:

bash-5.0# cat port-down-new.yml


  • name: “Get Junos OS configuration.”

hosts: junos

roles:

  • Juniper.junos

connection: local

gather_facts: no

tasks:

  • name: Retrieve facts from devices running Junos OS

junos_interfaces:

config:

  • name: ge-0/0/1

enabled: no

I think it needs ‘state: merged’ here as well.

https://docs.ansible.com/ansible/latest/collections/junipernetworks/junos/junos_interfaces_module.html#examples

Hello Dick,

Thanks for looking into this. I get the same error on adding state: merged. I also realized that state: merged is a default parameter and is automatically applied during the playbook execution.

Thanks,
Debasmita