From cb50af5fe12a09a58c637f98fbf092988b70c579 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Tue, 22 Sep 2009 16:59:29 +0200 Subject: s4:provision - Lets the user choose between the supported forest/domain function levels Adds a parameter "--function-level" which allows to specify the domain and forest function level. --- source4/setup/provision | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'source4/setup/provision') diff --git a/source4/setup/provision b/source4/setup/provision index 8bf08b9e39..9912138fa3 100755 --- a/source4/setup/provision +++ b/source4/setup/provision @@ -93,7 +93,10 @@ parser.add_option("--ldap-backend-type", type="choice", metavar="LDAP-BACKEND-TY parser.add_option("--ldap-backend-nosync", help="Configure LDAP backend not to call fsync() (for performance in test environments)", action="store_true") parser.add_option("--server-role", type="choice", metavar="ROLE", choices=["domain controller", "dc", "member server", "member", "standalone"], - help="Set server role to provision for (default standalone)") + help="The server role (domain controller | dc | member server | member | standalone). Default is standalone.") +parser.add_option("--function-level", type="choice", metavar="FOR-FUN-LEVEL", + choices=["2003", "2008", "2008_R2"], + help="The domain and forest function level (2003 | 2008 | 2008_R2). Default is (Windows) 2008 (Native).") parser.add_option("--partitions-only", help="Configure Samba's partitions, but do not modify them (ie, join a BDC)", action="store_true") parser.add_option("--targetdir", type="string", metavar="DIR", @@ -164,6 +167,15 @@ elif opts.server_role == "member": else: server_role = opts.server_role +if opts.function_level is None: + dom_for_fun_level = None +elif opts.function_level == "2003": + dom_for_fun_level = DS_DOMAIN_FUNCTION_2003 +elif opts.function_level == "2008": + dom_for_fun_level = DS_DOMAIN_FUNCTION_2008 +elif opts.function_level == "2008_R2": + dom_for_fun_level = DS_DOMAIN_FUNCTION_2008_R2 + creds = credopts.get_credentials(lp) creds.set_kerberos_state(DONT_USE_KERBEROS) @@ -190,12 +202,9 @@ provision(setup_dir, message, krbtgtpass=opts.krbtgtpass, machinepass=opts.machinepass, dnspass=opts.dnspass, root=opts.root, nobody=opts.nobody, wheel=opts.wheel, users=opts.users, - serverrole=server_role, + serverrole=server_role, dom_for_fun_level=dom_for_fun_level, ldap_backend_extra_port=opts.ldap_backend_extra_port, ldap_backend_type=opts.ldap_backend_type, - ldapadminpass=opts.ldapadminpass, - ol_mmr_urls=opts.ol_mmr_urls, - slapd_path=opts.slapd_path, - setup_ds_path=opts.setup_ds_path, - nosync=opts.nosync, - ldap_dryrun_mode=opts.ldap_dryrun_mode) + ldapadminpass=opts.ldapadminpass, ol_mmr_urls=opts.ol_mmr_urls, + slapd_path=opts.slapd_path, setup_ds_path=opts.setup_ds_path, + nosync=opts.nosync,ldap_dryrun_mode=opts.ldap_dryrun_mode) -- cgit