예제 #1
0
 def process(self):
     """Main processing function."""
     try:
         self.delete_replication_config()
         self.delete_log_files()
         BaseConfig.cleanup(True)
         os.system('systemctl restart slapd')
     except Exception as e:
         raise OpenldapPROVError(f'exception: {e}\n')
예제 #2
0
    def process(self):
        """Main processing function."""
        try:
            self.delete_replication_config()
            self.delete_log_files()
            BaseConfig.cleanup(True)
            # restart slapd
            if (os.system('kill -15 $(pidof slapd)') != 0):
                Log.error('failed to kill slapd process while cleanup')
                quit()
            if (os.system('/usr/sbin/slapd -u ldap -h \'ldapi:/// ldap:///\'')
                    != 0):
                Log.error('failed to start slapd in cleanup')
                quit()

        except Exception as e:
            raise OpenldapPROVError(f'exception: {e}\n')
예제 #3
0
    def process(self):
        """Main processing function."""
        try:
            self.delete_replication_config()
            self.delete_log_files()
            install_dir = self.get_confvalue(
                self.get_confkey('CONFIG>OPENLDAP_INSTALL_DIR'))
            data_dir = self.get_confvalue(
                self.get_confkey('CONFIG>OPENLDAP_DATA_DIR'))
            BaseConfig.cleanup(True, install_dir, data_dir)
            # restart slapd
            if (os.system('kill -15 $(pidof slapd)') != 0):
                Log.error('failed to kill slapd process while cleanup')
                quit()
            if (os.system('/usr/sbin/slapd -F ' + install_dir +
                          '/openldap/slapd.d -u ldap -h \'ldapi:/// ldap:///\''
                          ) != 0):
                Log.error('failed to start slapd in cleanup')
                quit()

        except Exception as e:
            raise OpenldapPROVError(f'exception: {e}\n')
예제 #4
0
 def configure_openldap(self):
     """Install and Configure Openldap over Non-SSL."""
     Log.debug("Inside config phaze, starting openldap base configuration")
     # Perform base configuration
     base_dn = self.get_confvalue(
         self.get_confkey('CONFIG>OPENLDAP_BASE_DN'))
     bind_base_dn = 'cn=admin,' + base_dn
     install_dir = self.get_confvalue(
         self.get_confkey('CONFIG>OPENLDAP_INSTALL_DIR'))
     data_dir = self.get_confvalue(
         self.get_confkey('CONFIG>OPENLDAP_DATA_DIR'))
     confvalues = {
         'base_dn': base_dn,
         'bind_base_dn': bind_base_dn,
         'install_dir': install_dir,
         'data_dir': data_dir
     }
     BaseConfig.perform_base_config(self.rootdn_passwd.decode("utf-8"),
                                    'True', confvalues)
     Log.debug("openldap base configuration completed successfully")
     # set openldap-replication
     Log.debug("Starting openldap replication")
     self.configure_openldap_replication(confvalues)
     Log.debug("Openldap replication configured successfully")