mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Updated connect/disconnect replica to work with both domainlevels
Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
parent
23f5edb4be
commit
aa30199e0b
@ -604,14 +604,31 @@ def sync_time(host, server):
|
||||
host.run_command(['ntpdate', server.hostname])
|
||||
|
||||
|
||||
def connect_replica(master, replica):
|
||||
kinit_admin(replica)
|
||||
replica.run_command(['ipa-replica-manage', 'connect', master.hostname])
|
||||
def connect_replica(master, replica, domain_level=None):
|
||||
if domain_level is None:
|
||||
domain_level = master.config.domain_level
|
||||
if domain_level == DOMAIN_LEVEL_0:
|
||||
replica.run_command(['ipa-replica-manage', 'connect', master.hostname])
|
||||
else:
|
||||
kinit_admin(master)
|
||||
master.run_command(["ipa", "topologysegment-add", DOMAIN_SUFFIX_NAME,
|
||||
"%s-to-%s" % (master.hostname, replica.hostname),
|
||||
"--leftnode=%s" % master.hostname,
|
||||
"--rightnode=%s" % replica.hostname
|
||||
])
|
||||
|
||||
|
||||
def disconnect_replica(master, replica):
|
||||
kinit_admin(replica)
|
||||
replica.run_command(['ipa-replica-manage', 'disconnect', master.hostname])
|
||||
def disconnect_replica(master, replica, domain_level=None):
|
||||
if domain_level is None:
|
||||
domain_level = master.config.domain_level
|
||||
if domain_level == DOMAIN_LEVEL_0:
|
||||
replica.run_command(['ipa-replica-manage', 'disconnect', master.hostname])
|
||||
else:
|
||||
kinit_admin(master)
|
||||
master.run_command(["ipa", "topologysegment-del", DOMAIN_SUFFIX_NAME,
|
||||
"%s-to-%s" % (master.hostname, replica.hostname),
|
||||
"--continue"
|
||||
])
|
||||
|
||||
|
||||
def kinit_admin(host):
|
||||
|
Loading…
Reference in New Issue
Block a user