basedn = 'dc=example,dc=com' replargs = {} srvs = [] m1replargs = { 'suffix': basedn, 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl" } os.environ['USE_GDB'] = "1" m1 = DSAdmin.createAndSetupReplica({ 'newrootpw': 'password', 'newhost': host1, 'newport': port1, 'newinst': 'm1', 'newsuffix': basedn, 'no_admin': True }, m1replargs ) del os.environ['USE_GDB'] replargs[m1] = m1replargs srvs.append(m1) m2replargs = m1replargs m2 = DSAdmin.createAndSetupReplica({ 'newrootpw': 'password', 'newhost': host2, 'newport': port2, 'newinst': 'm2', 'newsuffix': basedn,
'newinst': 'm1', 'newsuffix': basedn, 'no_admin': True } m1replargs = { 'suffix': basedn, 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl" } #os.environ['USE_DBX'] = "1" #os.environ['USE_CALLGRIND'] = "1" m1 = DSAdmin.createAndSetupReplica(createargs, m1replargs) #del os.environ['USE_CALLGRIND'] #del os.environ['USE_DBX'] if 'USE_DRD' in os.environ: del os.environ['USE_DRD'] if 'USE_CALLGRIND' in os.environ: del os.environ['USE_CALLGRIND'] m2replargs = m1replargs createargs['newhost'] = host2 createargs['newport'] = port2 createargs['newinst'] = 'm2' #os.environ['USE_GDB'] = "1" m2 = DSAdmin.createAndSetupReplica(createargs, m2replargs) #del os.environ['USE_GDB']
'newport': port1, 'newinst': 'm1', 'newsuffix': basedn, 'no_admin': True } m1replargs = { 'suffix': basedn, 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl", 'starttls': True, 'chain' : True } m1 = DSAdmin.createAndSetupReplica(m1createargs, m1replargs) #del os.environ['USE_DBX'] #os.environ['USE_DBX'] = 1 # copy c1 args from m1 c1createargs = dict([(key,val) for key,val in m1createargs.iteritems()]) c1['newhost'] = host2 c1['newport'] = port2 c1['newinst'] = 'c1' c1replargs = dict([(key,val) for key,val in m1replargs.iteritems()]) c1replargs['type'] = LEAF_TYPE clreplargs['chainargs'] = {'nsUseStartTLS': 'TRUE'} #os.environ['USE_DBX'] = "1" c1 = DSAdmin.createAndSetupReplica(c1createargs, c1replargs) #del os.environ['USE_DBX']
if ipawinsync: configfile = ['/share/dswinsyncipa/testipawinsyncplugin.ldif'] schemafile = ['/share/freeipa/freeipa/ipa-server/ipa-install/share/60ipaconfig.ldif', '/share/freeipa/freeipa/ipa-server/ipa-install/share/60kerberos.ldif', '/share/freeipa/freeipa/ipa-server/ipa-install/share/60radius.ldif'] else: configfile = [] schemafile = [] os.environ['USE_VALGRIND'] = "1" ds = DSAdmin.createAndSetupReplica({ 'newrootpw': rootpw1, 'newhost': host1, 'newport': port1, 'newinst': 'ds', 'newsuffix': suffix, 'verbose': False, 'no_admin': True, 'ConfigFile': configfile, 'SchemaFile': schemafile }, replargs ) os.environ['USE_VALGRIND'] = '' os.environ.pop('USE_VALGRIND') try: foo = os.environ['USE_VALGRIND'] except KeyError: print "should no longer have USE_VALGRIND env. var" if ipawinsync: print "Enable the memberof plugin . . ." dn = "cn=MemberOf Plugin,cn=plugins,cn=config"
#os.environ['USE_DBX'] = "1" m1replargs = { 'suffix': "dc=example,dc=com", 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl" } m1 = DSAdmin.createAndSetupReplica({ 'cfgdshost': host1, 'cfgdsport': cfgport, 'cfgdsuser': '******', 'cfgdspwd': 'admin', 'newrootpw': 'password', 'newhost': host1, 'newport': port1, 'newinst': 'm1', 'newsuffix': 'dc=example,dc=com', 'verbose': True }, m1replargs) #del os.environ['USE_DBX'] m2replargs = { 'suffix': "dc=example,dc=com", 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl" }
m1replargs = { 'suffix': suffix, 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl", 'log' : True } #os.environ['USE_DBX'] = "1" m1 = DSAdmin.createAndSetupReplica({ 'newrootpw': 'password', 'newhost': host1, 'newport': port1, 'newinst': 'm1', 'newsuffix': suffix, 'verbose': True, 'no_admin': True }, m1replargs ) #del os.environ['USE_DBX'] m2replargs = m1replargs #os.environ['USE_DBX'] = 1 m2 = DSAdmin.createAndSetupReplica({ 'newrootpw': 'password', 'newhost': host2, 'newport': port2, 'newinst': 'm2', 'newsuffix': suffix, 'verbose': True,
m1replargs = { 'suffix': "dc=example,dc=com", 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl", 'log' : True } #os.environ['USE_DBX'] = "1" m1 = DSAdmin.createAndSetupReplica({ 'newrootpw': 'password', 'newhost': host1, 'newport': cfgport+10, 'newinst': 'm1', 'newsuffix': 'dc=example,dc=com', 'verbose': True, 'no_admin': True }, m1replargs ) #del os.environ['USE_DBX'] m2replargs = { 'suffix': "dc=example,dc=com", 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl" } #os.environ['USE_DBX'] = 1 m2 = DSAdmin.createAndSetupReplica({
port2 = port1 + 10 basedn = 'dc=company,dc=com' m1replargs = { 'suffix': basedn, 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl" } os.environ['USE_GDB'] = "1" m1 = DSAdmin.createAndSetupReplica( { 'newrootpw': 'password', 'newhost': host1, 'newport': port1, 'newinst': 'm1', 'newsuffix': basedn, 'no_admin': True }, m1replargs) del os.environ['USE_GDB'] m2replargs = { 'suffix': basedn, 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl" } m2 = DSAdmin.createAndSetupReplica( {
'ConfigFile': configfile, 'no_admin': True } m1replargs = { 'suffix': basedn, 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl", 'bindmethod': 'SASL/GSSAPI', 'log' : False } #os.environ['USE_GDB'] = "1" m1 = DSAdmin.createAndSetupReplica(hostargs, m1replargs) #del os.environ['USE_GDB'] hostargs['newhost'] = host2 hostargs['newport'] = port2 hostargs['newinst'] = 'm2' m2replargs = m1replargs m2 = DSAdmin.createAndSetupReplica(hostargs, m2replargs) hostargs['newhost'] = host3 hostargs['newport'] = port3 hostargs['newinst'] = 'm3' m3replargs = m2replargs m3 = DSAdmin.createAndSetupReplica(hostargs, m3replargs)
m1replargs = { 'suffix': "dc=example,dc=com", 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl", 'log': True } #os.environ['USE_DBX'] = "1" m1 = DSAdmin.createAndSetupReplica( { 'newrootpw': 'password', 'newhost': host1, 'newport': cfgport + 10, 'newinst': 'm1', 'newsuffix': 'dc=example,dc=com', 'verbose': True, 'no_admin': True }, m1replargs) #del os.environ['USE_DBX'] m2replargs = { 'suffix': "dc=example,dc=com", 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl" } #os.environ['USE_DBX'] = 1 m2 = DSAdmin.createAndSetupReplica(
schemafile = [ '/share/freeipa/freeipa/ipa-server/ipa-install/share/60ipaconfig.ldif', '/share/freeipa/freeipa/ipa-server/ipa-install/share/60kerberos.ldif', '/share/freeipa/freeipa/ipa-server/ipa-install/share/60radius.ldif' ] else: configfile = [] schemafile = [] os.environ['USE_VALGRIND'] = "1" ds = DSAdmin.createAndSetupReplica( { 'newrootpw': rootpw1, 'newhost': host1, 'newport': port1, 'newinst': 'ds', 'newsuffix': suffix, 'verbose': False, 'no_admin': True, 'ConfigFile': configfile, 'SchemaFile': schemafile }, replargs) os.environ['USE_VALGRIND'] = '' os.environ.pop('USE_VALGRIND') try: foo = os.environ['USE_VALGRIND'] except KeyError: print "should no longer have USE_VALGRIND env. var" if ipawinsync: print "Enable the memberof plugin . . ." dn = "cn=MemberOf Plugin,cn=plugins,cn=config"
#os.environ['USE_DBX'] = "1" m1replargs = { 'suffix': "dc=example,dc=com", 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl" } m1 = DSAdmin.createAndSetupReplica( { 'cfgdshost': host1, 'cfgdsport': cfgport, 'cfgdsuser': '******', 'cfgdspwd': 'admin', 'newrootpw': 'password', 'newhost': host1, 'newport': port1, 'newinst': 'm1', 'newsuffix': 'dc=example,dc=com', 'verbose': True }, m1replargs) #del os.environ['USE_DBX'] m2replargs = { 'suffix': "dc=example,dc=com", 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl" }
'newinst': 'm1', 'newsuffix': 'dc=example,dc=com', 'no_admin': True } m1replargs = { 'suffix': "dc=example,dc=com", 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl" } os.environ['USE_GDB'] = "1" #os.environ['USE_CALLGRIND'] = "1" m1 = DSAdmin.createAndSetupReplica(createargs, m1replargs) #del os.environ['USE_CALLGRIND'] del os.environ['USE_GDB'] if 'USE_DRD' in os.environ: del os.environ['USE_DRD'] if 'USE_CALLGRIND' in os.environ: del os.environ['USE_CALLGRIND'] m2replargs = m1replargs createargs['newhost'] = host2 createargs['newport'] = port2 createargs['newinst'] = 'm2' #os.environ['USE_GDB'] = "1" m2 = DSAdmin.createAndSetupReplica(createargs, m2replargs) #del os.environ['USE_GDB']
cfgport = 1100 mreplargs = { 'suffix': "dc=example,dc=com", 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl" } #os.environ['USE_DBX'] = "1" m = DSAdmin.createAndSetupReplica({ 'newrootpw': 'password', 'newhost': host1, 'newport': cfgport+10, 'newinst': 'm', 'newsuffix': 'dc=example,dc=com', 'verbose': True, 'no_admin': True }, mreplargs ) #del os.environ['USE_DBX'] hreplargs = { 'suffix': "dc=example,dc=com", 'bename': "userRoot", 'binddn': "cn=replrepl,cn=config", 'bindcn': "replrepl", 'bindpw': "replrepl", 'type' : dsadmin.HUB_TYPE } #os.environ['USE_DBX'] = 1
'suffix': basedn, 'bename': "userRoot", 'binddn': replbinddn, 'bindcn': "replrepl", 'bindpw': "replrepl" } srvs = [] rootdn = "cn=directory manager" rootpw = 'password' for (host, port) in hostport: srv = DSAdmin.createAndSetupReplica( { 'newrootpw': rootpw, 'newhost': host, 'newport': port, 'newinst': '%s-%d' % (host, port), 'newsuffix': basedn, 'no_admin': True }, replargs) srvs.append(srv) print "create agreements and init consumers" srv = srvs[0] for xx in srvs: for yy in srvs: if xx == yy: continue agmt = xx.setupAgreement(yy, replargs) if xx == srv: xx.startReplication(agmt)
hostport.append((host, port)) basedn = "o=sasl.net" replbinddn = "cn=replrepl,cn=config" replargs = {"suffix": basedn, "bename": "userRoot", "binddn": replbinddn, "bindcn": "replrepl", "bindpw": "replrepl"} srvs = [] rootdn = "cn=directory manager" rootpw = "password" for (host, port) in hostport: srv = DSAdmin.createAndSetupReplica( { "newrootpw": rootpw, "newhost": host, "newport": port, "newinst": "%s-%d" % (host, port), "newsuffix": basedn, "no_admin": True, }, replargs, ) srvs.append(srv) print "create agreements and init consumers" srv = srvs[0] for xx in srvs: for yy in srvs: if xx == yy: continue agmt = xx.setupAgreement(yy, replargs) if xx == srv: