|
|
|
@ -23,12 +23,15 @@ import cl_overriding
|
|
|
|
|
from cl_vars_share import varsShare, clLocale
|
|
|
|
|
from os.path import exists as pathexists
|
|
|
|
|
from os import path
|
|
|
|
|
from cl_utils import isMount
|
|
|
|
|
from cl_utils import isMount, genpassword
|
|
|
|
|
from encrypt import getHash
|
|
|
|
|
|
|
|
|
|
class fillVars(varsShare):
|
|
|
|
|
"""Auxilary object for creating variables
|
|
|
|
|
|
|
|
|
|
Contains filling methods"""
|
|
|
|
|
addDn = lambda x,*y: ",".join(y)
|
|
|
|
|
genDn = lambda x,*y: "=".join(y)
|
|
|
|
|
|
|
|
|
|
def get_cl_env_path(self):
|
|
|
|
|
"""Path to env files"""
|
|
|
|
@ -630,3 +633,58 @@ class fillVars(varsShare):
|
|
|
|
|
|
|
|
|
|
and additional parameters caluclate packages"""
|
|
|
|
|
return {}
|
|
|
|
|
|
|
|
|
|
def get_ld_encrypt(self):
|
|
|
|
|
"""hash crypto algoritm"""
|
|
|
|
|
return 'ssha'
|
|
|
|
|
|
|
|
|
|
def get_ld_bind_login(self):
|
|
|
|
|
"""bind login"""
|
|
|
|
|
return 'proxyuser'
|
|
|
|
|
|
|
|
|
|
def get_ld_base_root(self):
|
|
|
|
|
"""base name LDAP"""
|
|
|
|
|
return 'calculate'
|
|
|
|
|
|
|
|
|
|
def get_ld_base_dn(self):
|
|
|
|
|
"""base DN LDAP"""
|
|
|
|
|
return self.genDn("dc", self.Get('ld_base_root'))
|
|
|
|
|
|
|
|
|
|
def get_ld_bind_dn(self):
|
|
|
|
|
"""bind DN LDAP"""
|
|
|
|
|
return self.addDn(self.genDn("cn", self.Get('ld_bind_login')),
|
|
|
|
|
self.Get('ld_base_dn'))
|
|
|
|
|
|
|
|
|
|
def get_ld_bind_pw(self):
|
|
|
|
|
"""bind password"""
|
|
|
|
|
return 'calculate'
|
|
|
|
|
|
|
|
|
|
def get_ld_bind_hash(self):
|
|
|
|
|
"""hash bind"""
|
|
|
|
|
return getHash(self.Get('ld_bind_pw'), self.Get('ld_encrypt'))
|
|
|
|
|
|
|
|
|
|
def get_ld_admin_login(self):
|
|
|
|
|
"""administrator name"""
|
|
|
|
|
return 'ldapadmin'
|
|
|
|
|
|
|
|
|
|
def get_ld_admin_dn(self):
|
|
|
|
|
"""root DN"""
|
|
|
|
|
return self.addDn(self.genDn("cn", self.Get('ld_admin_login')),
|
|
|
|
|
self.Get('ld_base_dn'))
|
|
|
|
|
|
|
|
|
|
def get_ld_admin_hash(self):
|
|
|
|
|
"""root hash"""
|
|
|
|
|
return getHash(self.Get('ld_admin_pw'), self.Get('ld_encrypt'))
|
|
|
|
|
|
|
|
|
|
def get_ld_admin_pw(self):
|
|
|
|
|
"""password root"""
|
|
|
|
|
return genpassword()
|
|
|
|
|
|
|
|
|
|
def get_ld_services(self):
|
|
|
|
|
"""Name from all services"""
|
|
|
|
|
return 'Services'
|
|
|
|
|
|
|
|
|
|
def get_ld_services_dn(self):
|
|
|
|
|
"""DN from all services"""
|
|
|
|
|
return self.addDn(self.genDn("ou", self.Get('ld_services')),
|
|
|
|
|
self.Get('ld_base_dn'))
|
|
|
|
|