Showing results for 
Search instead for 
Did you mean: 

IOS XE ASR1001-X Ansible/Netconf identityref error

Seth Beauchamp

Hello, I have an ASR1001-X running XE 16.9.4. I am working on an ansible playbook to make certain configuration changes using netconf and yang. It works just fine against a CSR1000v running 16.9.4, but when I try the ASR1001-X I get the error below. Even trying a simple get-config produces the same error. I can ssh to the command line of the router just fine, i can also retrieve the capabilities as well. Any ideas?


The full traceback is:
  File "/tmp/ansible_netconf_get_payload_tvs6bfsr/    module_utils/network/netconf/", line 86, in get_config
    response = conn.get_config(source=source, filter=filter)
  File "/tmp/ansible_netconf_get_payload_tvs6bfsr/    module_utils/network/common/", line 76, in __rpc__
    return self.parse_rpc_error(to_bytes(rpc_error, errors='surrogate_then_replace'))
  File "/tmp/ansible_netconf_get_payload_tvs6bfsr/    module_utils/network/common/", line 108, in parse_rpc_error
    raise ConnectionError(rpc_error)

fatal: [rtr01]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "display": null,
            "filter": null,
            "lock": "never",
            "source": "running"
    "msg": "b'error: expected type identityref, got boolean.\\nerror: expected type     identityref, got boolean.'"
3 Replies 3

Francesco Molino
VIP Mentor VIP Mentor
VIP Mentor

Don't have any asr right now available for testing but last time i used it, it was working just fine.
Have you followed this doc to validate netconf is enabled and accessible?

You got RPC connection error and I would definitely re-validate the connection part.

PS: Please don't forget to rate and select as validated answer if this answered your question

Netconf appears to work if I use something other than ansible. I did some more testing last night and this problem appears to be specifically with the interaction between anisble and the ASR1001-X with XE 16.9.4.


I tried the same playbook against an ISR 4321 and an ASR1002-HX both with XE 16.9.4 and did not have the RPC problem.

Have you tested getting the config without ansible first to see if that works? Then run it through ansible without any more tasks to see how it works.
I'm sorry I don't use too often ansible, I prefer using other librairies/tools

PS: Please don't forget to rate and select as validated answer if this answered your question
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers