Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netconf_config module is missing options #22410

Closed
userlerueda opened this issue Mar 8, 2017 · 6 comments · Fixed by #22429
Closed

netconf_config module is missing options #22410

userlerueda opened this issue Mar 8, 2017 · 6 comments · Fixed by #22429
Labels
affects_2.2 This issue/PR affects Ansible v2.2 bug This issue/PR relates to a bug. module This issue/PR relates to a module. networking Network category

Comments

@userlerueda
Copy link
Contributor

userlerueda commented Mar 8, 2017

ISSUE TYPE
  • Bug Report
COMPONENT NAME

netconf_config

ANSIBLE VERSION
ansible 2.2.1.0
  config file =
  configured module search path = Default w/o overrides
CONFIGURATION

N/A

OS / ENVIRONMENT

macOS 10.12.3

SUMMARY

netconf_config module has some options but it does not have all options required to make netconf work in specific scenarios, specifically it is missing the look_for_keys and allow_agent, this prevents connecting to some devices via netconf

STEPS TO REPRODUCE

Executing the playbook with the options that we have today does not allow for me to connect to the remote system via netconf.

---
- hosts: localhost
  connection: local
  tasks:
    - name: change something on nso
      netconf_config:
        host: 10.201.36.121
        username: admin
        password: changeme
        hostkey_verify: false
        xml: |
            <?xml version="1.0" encoding="UTF-8"?>
            <rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
              <get-config>
                <source>
                  <running/>
                </source>
                <filter select=" /nacm/groups" type="xpath"/>
              </get-config>
            </rpc>
EXPECTED RESULTS

Connection successfull and configuration applied.

ACTUAL RESULTS

Got error connecting to the device: Negotiation failed

No config file found; using defaults
 [WARNING]: Host file not found: /etc/ansible/hosts

 [WARNING]: provided hosts list is empty, only localhost is available

Loading callback plugin default of type stdout, v2.0 from /Users/userlerueda/Documents/virtualenv/default-py2/lib/python2.7/site-packages/ansible/plugins/callback/__init__.pyc

PLAYBOOK: site.yml *************************************************************
1 plays in site.yml

PLAY [localhost] ***************************************************************

TASK [setup] *******************************************************************
Using module file /Users/userlerueda/Documents/virtualenv/default-py2/lib/python2.7/site-packages/ansible/modules/core/system/setup.py
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: userlerueda
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo ~/.ansible/tmp/ansible-tmp-1488984687.56-194813298644492 `" && echo ansible-tmp-1488984687.56-194813298644492="` echo ~/.ansible/tmp/ansible-tmp-1488984687.56-194813298644492 `" ) && sleep 0'
<127.0.0.1> PUT /var/folders/lc/3qb2k8c57vx0rj94q5p1vqkr0000gn/T/tmpeuQgf5 TO /Users/userlerueda/.ansible/tmp/ansible-tmp-1488984687.56-194813298644492/setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /Users/userlerueda/.ansible/tmp/ansible-tmp-1488984687.56-194813298644492/ /Users/userlerueda/.ansible/tmp/ansible-tmp-1488984687.56-194813298644492/setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/Users/userlerueda/Documents/virtualenv/default-py2/bin/python2.7 /Users/userlerueda/.ansible/tmp/ansible-tmp-1488984687.56-194813298644492/setup.py; rm -rf "/Users/userlerueda/.ansible/tmp/ansible-tmp-1488984687.56-194813298644492/" > /dev/null 2>&1 && sleep 0'
ok: [localhost]

TASK [change something on nso] *************************************************
task path: /Users/userlerueda/Documents/github3/NFV-VMS/netconf_access/site.yml:5
Using module file /Users/userlerueda/Documents/virtualenv/default-py2/lib/python2.7/site-packages/ansible/modules/extras/network/netconf/netconf_config.py
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: userlerueda
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo ~/.ansible/tmp/ansible-tmp-1488984688.31-26526904820982 `" && echo ansible-tmp-1488984688.31-26526904820982="` echo ~/.ansible/tmp/ansible-tmp-1488984688.31-26526904820982 `" ) && sleep 0'
<127.0.0.1> PUT /var/folders/lc/3qb2k8c57vx0rj94q5p1vqkr0000gn/T/tmpomIynz TO /Users/userlerueda/.ansible/tmp/ansible-tmp-1488984688.31-26526904820982/netconf_config.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /Users/userlerueda/.ansible/tmp/ansible-tmp-1488984688.31-26526904820982/ /Users/userlerueda/.ansible/tmp/ansible-tmp-1488984688.31-26526904820982/netconf_config.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/Users/userlerueda/Documents/virtualenv/default-py2/bin/python2.7 /Users/userlerueda/.ansible/tmp/ansible-tmp-1488984688.31-26526904820982/netconf_config.py; rm -rf "/Users/userlerueda/.ansible/tmp/ansible-tmp-1488984688.31-26526904820982/" > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "failed": true,
    "invocation": {
        "module_args": {
            "host": "10.201.36.121",
            "hostkey_verify": false,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "port": 830,
            "username": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "xml": "<config xmlns=\"http://tail-f.com/ns/config/1.0\">\n  <pnp xmlns=\"http://tail-f.com/ned/cisco/pnp\">\n    <server>\n      <port>4433</port>\n      <use-ssl>true</use-ssl>\n    </server>\n  </pnp>\n</config>\n"
        },
        "module_name": "netconf_config"
    },
    "msg": "error connecting to the device: Negotiation failed"
}
	to retry, use: --limit @/Users/userlerueda/Documents/github3/NFV-VMS/netconf_access/site.retry

PLAY RECAP *********************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1
@ansibot
Copy link
Contributor

ansibot commented Mar 8, 2017

cc @lpenz
click here for bot help

@ansibot ansibot added affects_2.2 This issue/PR affects Ansible v2.2 bug_report module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. networking Network category labels Mar 8, 2017
@lpenz
Copy link

lpenz commented Mar 8, 2017

Thanks for identifying the issue, I'll take a look into it

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Mar 8, 2017
@userlerueda
Copy link
Contributor Author

I'm thinking we should expose the look_for_keys and allow_agent args on ncclient to the netconf_config module, changing those two to false solves my problem. I can submit a PR if you are ok.

@lpenz
Copy link

lpenz commented Mar 8, 2017

The code looks good. Just get a more descriptive commit message and we are good to go.

@userlerueda
Copy link
Contributor Author

Thanks @lpenz Do we need to update the module version number ?

@lpenz
Copy link

lpenz commented Mar 8, 2017

The module has no version itself.
I think you are looking at the "version" field in ANSIBLE_METADATA - that's the version of the metadata format.

privateip pushed a commit that referenced this issue Mar 24, 2017
Fixes issue #22410
Fix trailing whitespace at the end of line 66
Fix version_added: "2.3" for allow_agent and look_for_keys
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.2 This issue/PR affects Ansible v2.2 bug This issue/PR relates to a bug. module This issue/PR relates to a module. networking Network category
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants