From 559c76f761ff46c0d0e7f679d24d7ca5304db101 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Thu, 27 Aug 2009 14:12:55 -0400 Subject: 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) --- ipaserver/install/dsinstance.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ipaserver') 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 -- cgit