Skip to content

Commit 0a58b5a

Browse files
author
Dan Lavu
committed
ipa dns forwarders are no longer necessary
1 parent 45fb97c commit 0a58b5a

1 file changed

Lines changed: 0 additions & 49 deletions

File tree

sssd_test_framework/topology_controllers.py

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,6 @@ def topology_setup(self, client: ClientHost, ipa: IPAHost, trusted: ADHost | Sam
277277
self.logger.info(f"Topology '{self.name}' is already provisioned")
278278
return
279279

280-
# Configure DNS forwarder for AD domain on IPA server
281-
self.setup_dns_forwarder(ipa, trusted)
282-
283280
# Create trust
284281
self.logger.info(f"Establishing trust between {ipa.domain} and {trusted.domain}")
285282
ipa.kinit()
@@ -293,52 +290,6 @@ def topology_setup(self, client: ClientHost, ipa: IPAHost, trusted: ADHost | Sam
293290
# Backup so we can restore to this state after each test
294291
super().topology_setup()
295292

296-
def setup_dns_forwarder(self, ipa: IPAHost, trusted: ADHost | SambaHost) -> None:
297-
"""
298-
Configure DNS forwarder on IPA server for the trusted AD domain.
299-
300-
This ensures IPA can resolve the AD domain for trust establishment.
301-
"""
302-
self.logger.info(f"Configuring DNS forwarder for {trusted.domain} on {ipa.hostname}")
303-
ipa.kinit()
304-
305-
# Check if forwarder already exists
306-
result = ipa.conn.exec(
307-
["ipa", "dnsforwardzone-show", trusted.domain],
308-
raise_on_error=False,
309-
)
310-
311-
if result.rc == 0:
312-
self.logger.info(f"DNS forwarder for {trusted.domain} already exists, skipping")
313-
return
314-
315-
# Resolve AD server hostname to IP address (forwarder requires IP)
316-
# Use getattr to safely access the host attribute from the connection
317-
ad_hostname = getattr(trusted.conn, "host", trusted.hostname)
318-
try:
319-
ad_ip = socket.gethostbyname(ad_hostname)
320-
except socket.gaierror:
321-
self.logger.error(
322-
f"Could not resolve hostname '{ad_hostname}'. "
323-
"Please ensure it is resolvable from the test controller."
324-
)
325-
raise
326-
327-
# Add DNS forward zone pointing to the AD server IP
328-
ipa.conn.exec(
329-
[
330-
"ipa",
331-
"dnsforwardzone-add",
332-
trusted.domain,
333-
f"--forwarder={ad_ip}",
334-
"--forward-policy=only",
335-
]
336-
)
337-
338-
# Restart named to ensure it picks up the new forwarder zone
339-
ipa.conn.exec(["systemctl", "restart", "named"])
340-
self.logger.info(f"DNS forwarder for {trusted.domain} configured successfully")
341-
342293
# If this command is run on freshly started containers, it is possible the IPA is not yet
343294
# fully ready to create the trust. It takes a while for it to start working.
344295
@retry_command(max_retries=20, delay=5, match_stderr='CIFS server communication error: code "3221225581"')

0 commit comments

Comments
 (0)