def do(self, args=[]): completed = InstallCommand.do(self,args) if 'check' not in args and 'fix' not in args: MySQLCommand().do(['reset_root_pass']) admin_mail = inputs.get_input_string(t("What is the admin mail?"), CONF_MAP('mail','admin_mail')) smtp_server = inputs.get_input_string(t("What is the smtp server to use?"), CONF_MAP('mail','smtp_server')) CONFIG.mod('mail','admin_mail', admin_mail) CONFIG.mod('mail','smtp_server', smtp_server) CONFIG.save()
def do(self, args=[]): completed = InstallCommand.do(self,args) if inputs.get_input_yesno(t("Do you want to configure centrify/ldap now?")): if inputs.get_input_yesno(t("Will this machine use Active Directory?")): domain_name = inputs.get_input_string(t("What is the domain name?"), CONF_MAP('ldap','domain')) domain_controller = inputs.get_input_string(t("What is the address of the domain controller?"), CONF_MAP('ldap','dc')) domain_read_user = inputs.get_input_string(t("What is the ldap reader username?"), CONF_MAP('ldap','ldap_reader')) domain_read_pass = inputs.get_password(t("What is the ldap reader password?"),validate=False) domain_default_ou = inputs.get_input_string(t("What is the ldap default OU for uwsa?"), CONF_MAP('ldap','uwsa_ou')) CONFIG.mod('ldap','enabled', True) CONFIG.mod('ldap','domain', domain_name) CONFIG.mod('ldap','dc', domain_controller) CONFIG.mod('ldap','ldap_reader', domain_read_user) CONFIG.mod('ldap','ldap_reader_pass', domain_read_pass) CONFIG.mod('ldap','uwsa_ou', domain_default_ou) if not CONF_MAP('centrify', 'joined') and inputs.get_input_yesno(t("Do you want to join the Active Directory now?")): domain_admin_user = inputs.get_input_string(t("What is the domain admin username?")) domain_admin_pass = inputs.get_password(t("What is the domain admin password?"),confirm=False, validate=False) cmd_list = [ {'command' : 'adjoin -w --force --user %s --password %s %s' % (domain_admin_user, domain_admin_pass, domain_name), 'anonymous' : 'adjoin -w --force --user %s --password XXXXXXXXXXXXX %s' % (domain_admin_user, domain_name), 'success_code' : [0,8], }, 'service centrifydc start', ] completed, pinfo = core.exec_cmd_list(cmd_list) L.info(pinfo['stdout']) if not completed: raise Exception(t("Error in installation!"), self.NAME) CONFIG.mod('centrify','joined', "True" ) CONFIG.save() return completed