Open Aethylred opened 3 years ago
Files identified in the description:
If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
cc @Akasurde @Nosmoht @fxfitz click here for bot help
current workaround is:
ignore_error: yes
🔥
I'm looking at the code in https://github.com/ansible-collections/community.general/blob/9c648c8e3acedf0881c9fbeb08b353230457c945/plugins/modules/identity/ipa/ipa_dnsrecord.py
It's looking to me that the test for the IPA record exits line [258[(https://github.com/ansible-collections/community.general/blob/9c648c8e3acedf0881c9fbeb08b353230457c945/plugins/modules/identity/ipa/ipa_dnsrecord.py#L258) is failing, causing the module to try dnsrecord_add
when it should be moving on to comparing the existing record and trying dnsrecord_mod
Hmmm.... my script includes the trailing periods that are 'correct' for the name when creating a DNS record.
Actually with a few CLI tests I've figured it out. When you use ipa dnsrecord_find domain FQDN
it fails, you only want to search for the hostname
or hostname.subdomain
to ipa_dnsrecord
This is not clear in the documentation, and maybe updating the module to detect a FQDN and breaking off the hostname.subdomain
part for doing the dnsrecord_find
and comparing dnsrecords would make the module safer and more resilient.
The workaround (or correct usage depending on PoV) is to only use the short hostname
or hostname.subdomain
to specify the DNS record, rather than the FQDN, so my task becomes:
- name: Check DNS entry
ipa_dnsrecord:
name: hostname
record_value: "192.168.1.1"
record_type: A
zone_name: "example.com"
ipa_host: "ipaserver.example.com"
ipa_user: "admin}"
ipa_pass: "XXXXXX"
after which it passes
It still fails if using record_ttl. But fortunately record_ttl is not required anymore (previously the task failed without record_ttl).
cc @justchris1 click here for bot help
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.
The same issue happens with record_type: CNAME
when record_ttl
is set.
SUMMARY
When using ipa_dnsrecord to create & check a DNS A record it reports an error if the record exists and is not changed the IPA server responds with
msg: 'response dnsrecord_add: no modifications to be performed'
and Ansible reports this as an error and halts.Seems related to: https://github.com/ansible/ansible/issues/56872
ISSUE TYPE
COMPONENT NAME
plugins/modules/identity/ipa/ipa_dnsrecord.py
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
CentOS8, FreeIPA, version: 4.6.6
STEPS TO REPRODUCE
EXPECTED RESULTS
That the task would be unchanged after first run to create the DNS A record.
Also, the response
msg: 'response dnsrecord_add: no modifications to be performed'
should not be considered as an error.ACTUAL RESULTS