TASK [system_hosts : Edits the hosts file in /etc] ****************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleUndefinedVariable: 'dict object' has no attribute 'ipv4'
fatal: [host1.example.com]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'ipv4'"}
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleUndefinedVariable: 'dict object' has no attribute 'ipv4'
fatal: [host2.example.com]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'ipv4'"}
The full traceback is:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/ansible/template/__init__.py", line 1100, in do_template
res = j2_concat(rf)
File "<template>", line 108, in root
File "/usr/local/lib/python3.6/site-packages/ansible/template/__init__.py", line 265, in wrapper
ret = func(*args, **kwargs)
File "/opt/ansible/collections/ansible_collections/ansible/netcommon/plugins/filter/ipaddr.py", line 560, in ipaddr
elif not value or value is True:
File "/usr/local/lib/python3.6/site-packages/jinja2/runtime.py", line 903, in _fail_with_undefined_error
raise self._undefined_exception(self._undefined_message)
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'ipv4'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/ansible/plugins/action/template.py", line 146, in run
resultant = templar.do_template(template_data, preserve_trailing_newlines=True, escape_backslashes=False)
File "/usr/local/lib/python3.6/site-packages/ansible/template/__init__.py", line 1137, in do_template
raise AnsibleUndefinedVariable(e)
ansible.errors.AnsibleUndefinedVariable: 'dict object' has no attribute 'ipv4'
fatal: [host1.example.com]: FAILED! => {
"changed": false,
"msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'ipv4'"
}
Removing cached facs or direktly trigger ansible.builtin.setup as pre_tasks changed nothing.
Hey,
I just cloned the
master
branch and discovered that the deployment of the hosts file failed:I execute the role as the following:
The Error:
The full traceback is:
Removing cached facs or direktly trigger
ansible.builtin.setup
aspre_tasks
changed nothing.Proof that the dict object exists:
Can anyone reproduce this error?