Open Cinux90 opened 1 year ago
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @keachi click here for bot help
According to https://github.com/phihag/ipaddress/blob/master/ipaddress.py#L161 this should only happen on Python 2, since name
should be of type str
in https://github.com/ansible-collections/community.general/blob/main/plugins/modules/udm_dns_record.py#L161 (which only equals bytes
on Python 2).
Could it be that dns-server is using Python 2? The correct PTR handling was only implemented recently (#3256) and might never have been tested with Python 2 so far.
In any case, it might help to change line 161 (https://github.com/ansible-collections/community.general/blob/main/plugins/modules/udm_dns_record.py#L161) to
ipaddr_rev = ipaddress.ip_address(to_text(name)).reverse_pointer
where you need to add from ansible.module_utils.common.text.converters import to_text
to the imports.
Yes, you are completly right. dns-server runs python2:
root@ucs-6304:~# python --version
Python 2.7.13
As in the documentation of the udm_dns_record is stated that is need univention and python 2.6 or higher I expect that it works well.
Anyway, your workaround works fine for me. Thanks for that :+1:
(FYI: I used Univention in version 4 which supports python2. Version 5 will support python3)
Since this is not fixed, reopening.
Summary
I want to add a reverse zone entry in univention. But it failed because the IP is not an unicode object and I have no idea how to change that or if this is correct.
Also with ipv4 filter it is not working for me.
Any ideas whats wrong here?
Issue Type
Bug Report
Component Name
udm_dns_record
Ansible Version
Community.general Version
Configuration
OS / Environment
Ubuntu 22
Steps to Reproduce
Expected Results
reverse entry created
Actual Results
Code of Conduct