Only create DNS SRV records for ready server

When installing multiple replicas in parallel, one replica may create
SRV entries for other replicas, although the replicas aren't fully
installed yet. This may cause some services to connect to a server, that
isn't ready to serve requests.

The DNS IPASystemRecords framework now skips all servers that aren't
ready IPA masters.

See: https://pagure.io/freeipa/issue/7566
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
This commit is contained in:
Christian Heimes 2018-07-05 23:59:06 +02:00
parent 7c2ca14118
commit 10457a01bf

View File

@ -96,7 +96,9 @@ class IPASystemRecords(object):
self.servers_data = {}
servers_result = self.api_instance.Command.server_find(
no_members=False)['result']
no_members=False,
servrole=u"IPA master", # only active, fully installed masters
)['result']
for s in servers_result:
weight, location, roles = self.__get_server_attrs(s)
self.servers_data[s['cn'][0]] = {
@ -348,7 +350,9 @@ class IPASystemRecords(object):
zone_obj = zone.Zone(self.domain_abs, relativize=False)
if servers is None:
servers_result = self.api_instance.Command.server_find(
pkey_only=True)['result']
pkey_only=True,
servrole=u"IPA master", # only fully installed masters
)['result']
servers = [s['cn'][0] for s in servers_result]
locations_result = self.api_instance.Command.location_find()['result']