ansible-collections / cisco.iosxr

Ansible Network Collection for Cisco IOSXR
GNU General Public License v3.0
69 stars 48 forks source link

Validate unexpectedly fails in IOS XR netconf plugin (for 2.9.9) #75

Closed kmtenhouse closed 4 years ago

kmtenhouse commented 4 years ago
SUMMARY

The Validate capability is something we are looking to leverage and we have it working directly via Python. However, when using the IOS XR netconf plugin (in 2.9.9), receiving errors that it is unsupported by device.

ISSUE TYPE
COMPONENT NAME

Netconf plugin for IOS XR: plugins/netconf/iosxr.py

Note: I did see that this code is part of the main Ansible stable-2.9 branch. However, it was recommended that I instead open the issue here, as this will be the ongoing place for this plugin.

ANSIBLE VERSION
ansible 2.9.9
python version = 2.7.5 
CONFIGURATION
(no output was shown)
OS / ENVIRONMENT

Cisco IOS XR

STEPS TO REPRODUCE

Attempt to perform a task with a validate, ex:

- name: use lookup filter to provide xml configuration to be applied via netconf
connection: netconf
netconf_config:
target: "{{ netconf_target | default('candidate') }}"
error_option: "{{ netconf_error_option | default('rollback-on-error') }}"
commit: yes
validate: yes
default_operation: "merge"
content: |
<nc:config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
<cdp xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-cdp-cfg">
<enable>true</enable>
</cdp>
</nc:config>
register: result
vars:
ansible_persistent_log_messages: True
EXPECTED RESULTS

Expect validate to work - the debugs show the router does support this capability:

urn:ietf:params:netconf:capability:validate:1.0 Additionally, a team member has confirmed this worked using ncclient directly in python. ##### ACTUAL RESULTS When attempting the validate via Ansible, the following error is returned ``` "msg": "validate is not supported by this netconf server" ```
ikhan2010 commented 4 years ago

Thanks for raising the issue. cc @trishnaguha @ganeshrn

ganeshrn commented 4 years ago

Duplicate of https://github.com/ansible-collections/ansible.netcommon/issues/119 PR fix merged in devel branch https://github.com/ansible/ansible/pull/71195

stable-2.9 https://github.com/ansible/ansible/pull/71221 (review) stable-2.10 https://github.com/ansible/ansible/pull/71252 (review)