summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipaserver/dsinstance.py
diff options
context:
space:
mode:
authorPete Rowley <prowley@redhat.com>2007-11-06 15:57:15 -0800
committerPete Rowley <prowley@redhat.com>2007-11-06 15:57:15 -0800
commit24d5777bd682636b36b96193c2ec2c8bcb6f684f (patch)
treec0beab7c5fc76b4447b3ed6acd960614f684c0d8 /ipa-server/ipaserver/dsinstance.py
parent22493d9b9fbc0b6a2e35397ab7b6a62740fcfe7a (diff)
downloadfreeipa-24d5777bd682636b36b96193c2ec2c8bcb6f684f.tar.gz
freeipa-24d5777bd682636b36b96193c2ec2c8bcb6f684f.tar.xz
freeipa-24d5777bd682636b36b96193c2ec2c8bcb6f684f.zip
Add posix auto gen for single master case
Diffstat (limited to 'ipa-server/ipaserver/dsinstance.py')
-rw-r--r--ipa-server/ipaserver/dsinstance.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/ipa-server/ipaserver/dsinstance.py b/ipa-server/ipaserver/dsinstance.py
index 284ad3a6d..9a539470e 100644
--- a/ipa-server/ipaserver/dsinstance.py
+++ b/ipa-server/ipaserver/dsinstance.py
@@ -84,6 +84,7 @@ class DsInstance(service.Service):
self.__add_default_schemas()
self.__add_memberof_module()
self.__add_referint_module()
+ self.__add_dna_module()
self.__create_indeces()
self.__enable_ssl()
self.__certmap_conf()
@@ -93,7 +94,10 @@ class DsInstance(service.Service):
except:
# TODO: roll back here?
logging.critical("Failed to restart the ds instance")
+ self.__config_uidgid_gen_first_master()
self.__add_default_layout()
+ self.__add_master_entry_first_master()
+
self.step("configuring directoy to start on boot")
self.chkconfig_on()
@@ -183,6 +187,36 @@ class DsInstance(service.Service):
print "Failed to load referint-conf.ldif", e
referint_fd.close()
+ def __add_dna_module(self):
+ self.step("enabling distributed numeric assignment plugin")
+ dna_txt = template_file(SHARE_DIR + "dna-conf.ldif", self.sub_dict)
+ dna_fd = write_tmp_file(dna_txt)
+ try:
+ ldap_mod(dna_fd, "cn=Directory Manager", self.dm_password)
+ except subprocess.CalledProcessError, e:
+ print "Failed to load dna-conf.ldif", e
+ dna_fd.close()
+
+ def __config_uidgid_gen_first_master(self):
+ self.step("configuring Posix uid/gid generation as first master")
+ dna_txt = template_file(SHARE_DIR + "dna-posix.ldif", self.sub_dict)
+ dna_fd = write_tmp_file(dna_txt)
+ try:
+ ldap_mod(dna_fd, "cn=Directory Manager", self.dm_password)
+ except subprocess.CalledProcessError, e:
+ print "Failed to configure Posix uid/gid generation with dna-posix.ldif", e
+ dna_fd.close()
+
+ def __add_master_entry_first_master(self):
+ self.step("adding master entry as first master")
+ master_txt = template_file(SHARE_DIR + "master-entry.ldif", self.sub_dict)
+ master_fd = write_tmp_file(master_txt)
+ try:
+ ldap_mod(master_fd, "cn=Directory Manager", self.dm_password)
+ except subprocess.CalledProcessError, e:
+ print "Failed to add master-entry.ldif", e
+ master_fd.close()
+
def __enable_ssl(self):
self.step("configuring ssl for ds instance")
dirname = self.config_dirname()