summaryrefslogtreecommitdiffstats
path: root/source4/scripting/python/samba/netcmd/domain.py
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-06-21 23:46:21 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-06-25 00:26:41 +1000
commit01f52239dc8e13af6e5134667c55d8e0fb7b2f26 (patch)
treee9af1aad6b215c319ba73f7d4b8cd1c8d2cc6335 /source4/scripting/python/samba/netcmd/domain.py
parent0eab44c2978553bda303c43875d626fddf32363d (diff)
downloadsamba-01f52239dc8e13af6e5134667c55d8e0fb7b2f26.tar.gz
samba-01f52239dc8e13af6e5134667c55d8e0fb7b2f26.tar.xz
samba-01f52239dc8e13af6e5134667c55d8e0fb7b2f26.zip
s4-join: Import DNS zones in AD DC join
Diffstat (limited to 'source4/scripting/python/samba/netcmd/domain.py')
-rw-r--r--source4/scripting/python/samba/netcmd/domain.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py
index 8199c41aba7..4e73a29140e 100644
--- a/source4/scripting/python/samba/netcmd/domain.py
+++ b/source4/scripting/python/samba/netcmd/domain.py
@@ -148,15 +148,21 @@ class cmd_domain_join(Command):
Option("--machinepass", type=str, metavar="PASSWORD",
help="choose machine password (otherwise random)"),
Option("--use-ntvfs", help="Use NTVFS for the fileserver (default = no)",
- action="store_true")
- ]
+ action="store_true"),
+ Option("--dns-backend", type="choice", metavar="NAMESERVER-BACKEND",
+ choices=["SAMBA_INTERNAL", "BIND9_DLZ", "NONE"],
+ help="The DNS server backend. SAMBA_INTERNAL is the builtin name server, " \
+ "BIND9_DLZ uses samba4 AD to store zone information (default), " \
+ "NONE skips the DNS setup entirely (this DC will not be a DNS server)",
+ default="BIND9_DLZ")
+ ]
takes_args = ["domain", "role?"]
def run(self, domain, role=None, sambaopts=None, credopts=None,
versionopts=None, server=None, site=None, targetdir=None,
domain_critical_only=False, parent_domain=None, machinepass=None,
- use_ntvfs=False):
+ use_ntvfs=False, dns_backend=None):
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
net = Net(creds, lp, server=credopts.ipaddress)
@@ -181,13 +187,13 @@ class cmd_domain_join(Command):
join_DC(server=server, creds=creds, lp=lp, domain=domain,
site=site, netbios_name=netbios_name, targetdir=targetdir,
domain_critical_only=domain_critical_only,
- machinepass=machinepass, use_ntvfs=use_ntvfs)
+ machinepass=machinepass, use_ntvfs=use_ntvfs, dns_backend=dns_backend)
return
elif role == "RODC":
join_RODC(server=server, creds=creds, lp=lp, domain=domain,
site=site, netbios_name=netbios_name, targetdir=targetdir,
domain_critical_only=domain_critical_only,
- machinepass=machinepass, use_ntvfs=use_ntvfs)
+ machinepass=machinepass, use_ntvfs=use_ntvfs, dns_backend=dns_backend)
return
elif role == "SUBDOMAIN":
netbios_domain = lp.get("workgroup")
@@ -195,7 +201,7 @@ class cmd_domain_join(Command):
parent_domain = ".".join(domain.split(".")[1:])
join_subdomain(server=server, creds=creds, lp=lp, dnsdomain=domain, parent_domain=parent_domain,
site=site, netbios_name=netbios_name, netbios_domain=netbios_domain, targetdir=targetdir,
- machinepass=machinepass, use_ntvfs=use_ntvfs)
+ machinepass=machinepass, use_ntvfs=use_ntvfs, dns_backend=dns_backend)
return
else:
raise CommandError("Invalid role '%s' (possible values: MEMBER, DC, RODC, SUBDOMAIN)" % role)