diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-06-24 21:10:34 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-06-24 18:10:10 +0200 |
commit | c983ea8e5dc30111f6b8407307c3212635593949 (patch) | |
tree | 4ae1a678d05093c97c5fe6b948d12f526ea44a45 /source4/scripting/python/samba/join.py | |
parent | 02cbc3fbb601cbbfc86a7048f6d5660d80f14df1 (diff) | |
download | samba-c983ea8e5dc30111f6b8407307c3212635593949.tar.gz samba-c983ea8e5dc30111f6b8407307c3212635593949.tar.xz samba-c983ea8e5dc30111f6b8407307c3212635593949.zip |
s4-join: Setup correct DNS configuration
This means we do not need to run samba_upgradedns any more.
Andrew Bartlett
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sun Jun 24 18:10:10 CEST 2012 on sn-devel-104
Diffstat (limited to 'source4/scripting/python/samba/join.py')
-rw-r--r-- | source4/scripting/python/samba/join.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/join.py b/source4/scripting/python/samba/join.py index b1901e0421..9ef7d3dd17 100644 --- a/source4/scripting/python/samba/join.py +++ b/source4/scripting/python/samba/join.py @@ -28,6 +28,7 @@ from samba.credentials import Credentials, DONT_USE_KERBEROS from samba.provision import secretsdb_self_join, provision, provision_fill, FILL_DRS, FILL_SUBDOMAIN from samba.schema import Schema from samba.net import Net +from samba.provision.sambadns import setup_bind9_dns import logging import talloc import random @@ -642,7 +643,7 @@ class dc_join(object): targetdir=ctx.targetdir, samdb_fill=FILL_SUBDOMAIN, machinepass=ctx.acct_pass, serverrole="domain controller", lp=ctx.lp, hostip=ctx.names.hostip, hostip6=ctx.names.hostip6, - dns_backend="BIND9_DLZ") + dns_backend=ctx.dns_backend) print("Provision OK for domain %s" % ctx.names.dnsdomain) def join_replicate(ctx): @@ -741,6 +742,9 @@ class dc_join(object): def join_finalise(ctx): '''finalise the join, mark us synchronised and setup secrets db''' + logger = logging.getLogger("provision") + logger.addHandler(logging.StreamHandler(sys.stdout)) + print "Sending DsReplicateUpdateRefs for all the partitions" for nc in ctx.full_nc_list: ctx.send_DsReplicaUpdateRefs(nc) @@ -768,6 +772,15 @@ class dc_join(object): secure_channel_type=ctx.secure_channel_type, key_version_number=ctx.key_version_number) + if ctx.dns_backend.startswith("BIND9_"): + dnspass = samba.generate_random_password(128, 255) + + setup_bind9_dns(ctx.local_samdb, secrets_ldb, security.dom_sid(ctx.domsid), + ctx.names, ctx.paths, ctx.lp, logger, + dns_backend=ctx.dns_backend, + dnspass=dnspass, os_level=ctx.behavior_version, + targetdir=ctx.targetdir) + def join_setup_trusts(ctx): '''provision the local SAM''' |