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



Following is the error I receive: 

*bash-5.0# ansible-playbook port-down-new.yml -i junos.inv -vvv*

ansible-playbook 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-playbook

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

Using /project/ansible.cfg as config file

host_list declined parsing /project/junos.inv as it did not pass its 
verify_file() method

auto declined parsing /project/junos.inv as it did not pass its 
verify_file() method

yaml declined parsing /project/junos.inv as it did not pass its 
verify_file() method

Parsed /project/junos.inv inventory source with ini plugin

redirecting (type: modules) ansible.builtin.junos_interfaces to 
junipernetworks.junos.junos_interfaces


PLAYBOOK: port-down-new.yml 
***********************************************************************************************

1 plays in port-down-new.yml


PLAY [Get Junos OS configuration.] 
****************************************************************************************

META: ran handlers


TASK [Retrieve facts from devices running Junos OS] 
***********************************************************************

*task path: /project/port-down-new.yml:11*

redirecting (type: action) ansible.builtin.junos to 
junipernetworks.junos.junos

redirecting (type: action) ansible.builtin.junos to 
junipernetworks.junos.junos

<10.85.242.183> using connection plugin ansible.netcommon.netconf (was 
local)

<10.85.242.183> ESTABLISH LOCAL CONNECTION FOR USER: root

<10.85.242.183> EXEC /bin/sh -c 'echo ~root && sleep 0'

<10.85.242.183> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo 
/root/.ansible/tmp `"&& mkdir "` echo 
/root/.ansible/tmp/ansible-tmp-1603774438.2565486-1028-27196404287972 `" && 
echo ansible-tmp-1603774438.2565486-1028-27196404287972="` echo 
/root/.ansible/tmp/ansible-tmp-1603774438.2565486-1028-27196404287972 `" ) 
&& sleep 0'

redirecting (type: modules) ansible.builtin.junos_interfaces to 
junipernetworks.junos.junos_interfaces

<test-ex3400> Attempting python interpreter discovery

<10.85.242.183> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command 
-v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v 
'"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v 
'"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v 
'"'"'/usr/libexec/platform-python'"'"'; command -v 
'"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && 
sleep 0'

<10.85.242.183> EXEC /bin/sh -c '/usr/bin/python && sleep 0'

<test-ex3400> Python interpreter discovery fallback (unsupported Linux 
distribution: alpine)

Using module file 
/root/.ansible/collections/ansible_collections/junipernetworks/junos/plugins/modules/junos_interfaces.py

<10.85.242.183> PUT 
/root/.ansible/tmp/ansible-local-1022po7l15vg/tmptsvz95ns TO 
/root/.ansible/tmp/ansible-tmp-1603774438.2565486-1028-27196404287972/AnsiballZ_junos_interfaces.py

<10.85.242.183> EXEC /bin/sh -c 'chmod u+x 
/root/.ansible/tmp/ansible-tmp-1603774438.2565486-1028-27196404287972/ 
/root/.ansible/tmp/ansible-tmp-1603774438.2565486-1028-27196404287972/AnsiballZ_junos_interfaces.py
 
&& sleep 0'

<10.85.242.183> EXEC /bin/sh -c '/usr/bin/python 
/root/.ansible/tmp/ansible-tmp-1603774438.2565486-1028-27196404287972/AnsiballZ_junos_interfaces.py
 
&& sleep 0'

<10.85.242.183> EXEC /bin/sh -c 'rm -f -r 
/root/.ansible/tmp/ansible-tmp-1603774438.2565486-1028-27196404287972/ > 
/dev/null 2>&1 && sleep 0'

*[WARNING]: Platform linux on host test-ex3400 is using the discovered 
Python interpreter at /usr/bin/python, but future*

*installation of another Python interpreter could change the meaning of 
that path. See*

*https://docs.ansible.com/ansible/2.10/reference_appendices/interpreter_discovery.html
 
for more information.*

*[WARNING]: ['connection local support for this module is deprecated and 
will be removed in version 2.14, use connection*

*ansible.netcommon.netconf']*

fatal: [test-ex3400]: FAILED! => {

    "ansible_facts": {

        "discovered_interpreter_python": "/usr/bin/python"

    },

    "changed": false,

    "invocation": {

        "module_args": {

            "config": [

                {

                    "enabled": false,

                    "name": "ge-0/0/1"

                }

            ],

            "provider": {

                "host": null,

                "password": null,

                "port": null,

                "ssh_keyfile": null,

                "timeout": null,

                "transport": "netconf",

                "username": null

            }

        }

    },

*    "msg": "Unsupported parameters for (junos_interfaces) module: provider 
Supported parameters include: config, running_config, state"*

*}*


PLAY RECAP 
****************************************************************************************************************

test-ex3400                : ok=0    changed=0    unreachable=0    
failed=1    skipped=0    rescued=0    ignored=0   



-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4566b567-754c-4cc2-a318-1fce44789b2bn%40googlegroups.com.

Reply via email to