def reset_pass(self, args): completed = False q = t("This command will reset mysql root password. The database WILL BE SHUTDOWN in the process. Do you want to continue?") if inputs.get_input_noyes(q): password = inputs.get_password(t("What is the new root password?"), validate=False) if password is not None: completed = mysql.reset_root_password(password) return completed
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
def ask_mysql_cred(self): if mysql.MYSQL_USER != 'root': mysql.MYSQL_USER = '******' mysql.MYSQL_PASS = inputs.get_password(t("What is the mysql password for root?"), confirm=False, validate=False)
def ask_domain_admin(self): if self.domain_admin_user is None or self.domain_admin_user is None: self.domain_admin_user = inputs.get_input_string(t("What is the domain admin username?")) self.domain_admin_pass = inputs.get_password(t("What is the domain admin password?"), confirm=False, validate=False) ldap.DOMAIN_USER = self.domain_admin_user ldap.DOMAIN_PASS = self.domain_admin_pass