summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/dsinstance.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2009-08-27 14:12:55 -0400
committerRob Crittenden <rcritten@redhat.com>2009-08-27 14:15:26 -0400
commit559c76f761ff46c0d0e7f679d24d7ca5304db101 (patch)
tree7df5b1122aca7283bc4a01bfc4afb80e6f265c68 /ipaserver/install/dsinstance.py
parentcab55250760ad1633ed115564f83750fd91e230d (diff)
downloadfreeipa-559c76f761ff46c0d0e7f679d24d7ca5304db101.tar.gz
freeipa-559c76f761ff46c0d0e7f679d24d7ca5304db101.tar.xz
freeipa-559c76f761ff46c0d0e7f679d24d7ca5304db101.zip
Add option to the installer for uid/gid starting numbers.
This also adds a new option to the template system. If you include eval(string) in a file that goes through the templater then the string in the eval will be evaluated by the Python interpreter. This is used so one can do $UIDSTART+1. If any errors occur during the evaluation the original string is is returned, eval() and all so it is up to the developer to make sure the evaluation passes. The default value for uid and gid is now a random value between 1,000,000 and (2^31 - 1,000,000)
Diffstat (limited to 'ipaserver/install/dsinstance.py')
-rw-r--r--ipaserver/install/dsinstance.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/ipaserver/install/dsinstance.py b/ipaserver/install/dsinstance.py
index 061b827bc..90d64b112 100644
--- a/ipaserver/install/dsinstance.py
+++ b/ipaserver/install/dsinstance.py
@@ -151,7 +151,7 @@ class DsInstance(service.Service):
else:
self.suffix = None
- def create_instance(self, ds_user, realm_name, host_name, domain_name, dm_password, pkcs12_info=None, self_signed_ca=False):
+ def create_instance(self, ds_user, realm_name, host_name, domain_name, dm_password, pkcs12_info=None, self_signed_ca=False, uidstart=1100, gidstart=1100):
self.ds_user = ds_user
self.realm_name = realm_name.upper()
self.serverid = realm_to_serverid(self.realm_name)
@@ -161,6 +161,8 @@ class DsInstance(service.Service):
self.domain = domain_name
self.pkcs12_info = pkcs12_info
self.self_signed_ca = self_signed_ca
+ self.uidstart = uidstart
+ self.gidstart = gidstart
self.__setup_sub_dict()
self.step("creating directory server user", self.__create_ds_user)
@@ -198,7 +200,8 @@ class DsInstance(service.Service):
PASSWORD=self.dm_password, SUFFIX=self.suffix.lower(),
REALM=self.realm_name, USER=self.ds_user,
SERVER_ROOT=server_root, DOMAIN=self.domain,
- TIME=int(time.time()))
+ TIME=int(time.time()), UIDSTART=self.uidstart,
+ GIDSTART=self.gidstart)
def __create_ds_user(self):
user_exists = True