One_vm KeyError: 'IP'

Hello,

I am trying to configure a playbook in ansible that deploys a redhat server in opennebula using a template but when I run the playbook it shows me the following error:

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'IP'
fatal: [ondir01]: FAILED! => {"changed": false, "module_stderr": "Shared connection to ondir01 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n  File \"/home/ansible/.ansible/tmp/ansible-tmp-1621249443.31-30213-185507108826660/AnsiballZ_one_vm.py\", line 102, in <module>\r\n    _ansiballz_main()\r\n  File \"/home/ansible/.ansible/tmp/ansible-tmp-1621249443.31-30213-185507108826660/AnsiballZ_one_vm.py\", line 94, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/home/ansible/.ansible/tmp/ansible-tmp-1621249443.31-30213-185507108826660/AnsiballZ_one_vm.py\", line 40, in invoke_module\r\n    runpy.run_module(mod_name='ansible_collections.community.general.plugins.modules.one_vm', init_globals=None, run_name='__main__', alter_sys=True)\r\n  File \"/usr/lib64/python2.7/runpy.py\", line 176, in run_module\r\n    fname, loader, pkg_name)\r\n  File \"/usr/lib64/python2.7/runpy.py\", line 82, in _run_module_code\r\n    mod_name, mod_fname, mod_loader, pkg_name)\r\n  File \"/usr/lib64/python2.7/runpy.py\", line 72, in _run_code\r\n    exec code in run_globals\r\n  File \"/tmp/ansible_community.general.one_vm_payload_qHFIEl/ansible_community.general.one_vm_payload.zip/ansible_collections/community/general/plugins/modules/one_vm.py\", line 1604, in <module>\r\n  File \"/tmp/ansible_community.general.one_vm_payload_qHFIEl/ansible_community.general.one_vm_payload.zip/ansible_collections/community/general/plugins/modules/one_vm.py\", line 1523, in main\r\n  File \"/tmp/ansible_community.general.one_vm_payload_qHFIEl/ansible_community.general.one_vm_payload.zip/ansible_collections/community/general/plugins/modules/one_vm.py\", line 1068, in create_count_of_vms\r\n  File \"/tmp/ansible_community.general.one_vm_payload_qHFIEl/ansible_community.general.one_vm_payload.zip/ansible_collections/community/general/plugins/modules/one_vm.py\", line 956, in create_vm\r\n  File \"/tmp/ansible_community.general.one_vm_payload_qHFIEl/ansible_community.general.one_vm_payload.zip/ansible_collections/community/general/plugins/modules/one_vm.py\", line 758, in get_vm_info\r\nKeyError: 'IP'\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

and this error is not shown if within the playbook I remove the NIC section of the template, any suggestions?

Thank you.

Hello,

I have solved the problem in the post Add NIC without IP/MAC - #4 by jeyc.

Thank you.