Reputation: 1
I am working through a short Cisco DevNet course on Ansible pushing playbooks to a node in CML. I made it through the section using Cisco IOSXE modules with no issue and have now made it to NETCONF. Im recieving a error iter() returned non-iterator of type 'dict_keys'
when using these NETCONF plays. I have looked for solutions and have been trying to get this to work for about 6 hours now.
Error received:
fatal: [10.0.15.5]: FAILED! => {"changed": false, "module_stderr": "iter() returned non-iterator of type 'dict_keys'", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"}
I have tried using variables in the hosts file as well as in a /group_var/cisco.yml
file, reboot the CML node, tried on Ubuntu, WSL, and installed a fresh RHEL to start over and try again.
Here are my current files...
Directory
[admin@localhost Automation-Stuff\]$ ls
ansible.cfg group_vars hosts host_vars play.yml
ansible.cfg
[defaults]
gathering=explicit
inventory=./hosts
host_key_checking=False
deprecation_warnings=False
interpreter_python=/usr/local/bin/python3
hosts
[cisco:vars]
ansible_connection=ansible.netcommon.netconf
netconf_port=830
ansible_user=admin
ansible_password=C1sco12345
ansible_become=yes
ansible_become_method=enable
ansible_network_os=cisco.ios.ios
subnet_id=5
Heres the playbook play.yml
---
- name: NETCONF set NTP server
hosts: cisco
gather_facts: false
tasks:
- name: set ntp server
ansible.netcommon.netconf_config:
content: |
<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
<ntp>
<server xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-ntp">
<server-list>
<ip-address>10.1.{{subnet_id}}.1</ip-address>
</server-list>
</server>
</ntp>
</native>
</config>
Here is the play output
[admin@localhost Automation-Stuff]$ ansible-playbook play.yml
PLAY [NETCONF set NTP server] ************************************************************************************************************************************************************************************************************
TASK [set ntp server] ********************************************************************************************************************************************************************************************************************
fatal: [10.0.15.5]: FAILED! => {"changed": false, "module_stderr": "iter() returned non-iterator of type 'dict_keys'", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"}
PLAY RECAP *******************************************************************************************************************************************************************************************************************************
10.0.15.5 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Upvotes: 0
Views: 42