示例#1
0
def install_java(configData, full_path):

    if json_key in configData:
        jsonData = configData[json_key]
    else:
        print service_name + " config data missing from json. will not install"
        return

    if (platform.system() == "SunOS"):
        binary_path = full_path + "/binaries/java1.8/solaris"
    else:
        binary_path = full_path + "/binaries/java1.8"

    requiredFields = ['javaHome', 'installOwner', 'installGroup']
    commerce_setup_helper.check_required_fields(jsonData, requiredFields)
    INSTALL_OWNER = jsonData['installOwner']
    INSTALL_GROUP = jsonData['installGroup']
    JAVA_HOME = jsonData['javaHome']

    commerce_setup_helper.mkdir_with_perms(JAVA_HOME, INSTALL_OWNER,
                                           INSTALL_GROUP)

    # solaris setup is different
    if (platform.system() == "SunOS"):
        install64bitCommand = "\"" + "cd " + JAVA_HOME + "; tar zxf " + binary_path + "/jdk-8u73-solaris-sparcv9.tar.gz " + "\""
    else:
        installCommand = "\"" + "tar zxf " + binary_path + "/jdk-8u73-linux-x64.tar.gz -C " + JAVA_HOME + "\""

    linkCommand = "\"" + "ln -sf " + JAVA_HOME + "/jdk1.8.0_73 " + JAVA_HOME + "/latest" + "\""

    if (platform.system() == "SunOS"):
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, install64bitCommand)
    else:
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, installCommand)

    if (os.path.exists(JAVA_HOME + "/latest")
            or os.path.islink(JAVA_HOME + "/latest")):
        os.remove(JAVA_HOME + "/latest")
    os.symlink(JAVA_HOME + "/jdk1.8.0_73", JAVA_HOME + "/latest")

    # commerce_setup_helper.exec_as_user(INSTALL_OWNER, linkCommand)
    if (platform.system() != "SunOS"):
        if (os.path.exists('/usr/bin/java')
                or os.path.islink('/usr/bin/java')):
            os.remove('/usr/bin/java')
        os.symlink(JAVA_HOME + '/latest/bin/java', '/usr/bin/java')

    # add bashrc entries
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                        "##################### \n")
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER, "#Java Settings \n")
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                        "##################### \n")
    commerce_setup_helper.add_to_bashrc(
        INSTALL_OWNER, "export JAVA_HOME=" + JAVA_HOME + "/latest \n")
    commerce_setup_helper.add_to_bashrc(
        INSTALL_OWNER, "export PATH=" + JAVA_HOME + "/latest/bin:$PATH \n\n")

    os.environ['JAVA_HOME'] = JAVA_HOME
    os.environ["PATH"] = JAVA_HOME + "/bin" + os.pathsep + os.environ["PATH"]
示例#2
0
def install_mdex(configData, full_path):
    endecaData = configData[json_key]
    requiredFields = ['installOwner', 'installGroup']
    commerce_setup_helper.check_required_fields(endecaData, requiredFields)
    INSTALL_OWNER = endecaData['installOwner']
    INSTALL_GROUP = endecaData['installGroup']
    if 'mdex' in endecaData:
        jsonData = endecaData['mdex']
        requiredFields = ['endecaRoot']
        commerce_setup_helper.check_required_fields(jsonData, requiredFields)
    else:
        logging.error(service_name +
                      " config data missing from json. will not install")
        return

    logging.info("installing " + service_name)

    if (platform.system() == "SunOS"):
        binary_path = full_path + "/binaries/endeca11.3/solaris"
        install_exec = "/MDEX_Install/OCmdex6.5.3-Solaris.bin"
    else:
        binary_path = full_path + "/binaries/endeca11.3"
        install_exec = "/MDEX_Install/OCmdex11.3.0-Linux64_1186050.bin"

    response_files_path = full_path + "/responseFiles/endeca11.3"
    full_exec_path = binary_path + install_exec

    if not os.path.exists(full_exec_path):
        logging.error("Binary " + full_exec_path +
                      " does not exist - will not install")
        return False

    if jsonData is not None:
        ENDECA_ROOT = jsonData['endecaRoot']
        # make the install tree with correct owner if needed
        commerce_setup_helper.mkdir_with_perms(ENDECA_ROOT, INSTALL_OWNER,
                                               INSTALL_GROUP)

        # data field to replace in our silent installer file
        field_replacements = {'INSTALLATION_DIR': ENDECA_ROOT}

        commerce_setup_helper.substitute_file_fields(
            response_files_path + '/mdex_response.rsp.master',
            response_files_path + '/mdex_response.rsp', field_replacements)

        installCommand = "\"" + full_exec_path + " -i silent -f " + response_files_path + '/mdex_response.rsp' + "\""
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, installCommand)

        # add bashrc entries
        commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                            "##################### \n")
        commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                            "#Endeca Settings \n")
        commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                            "##################### \n")
        commerce_setup_helper.add_to_bashrc(
            INSTALL_OWNER, "source " + ENDECA_ROOT +
            "/endeca/MDEX/11.3.0/mdex_setup_sh.ini \n")
        commerce_setup_helper.add_to_bashrc(
            INSTALL_OWNER, "export ENDECA_HOME=" + ENDECA_ROOT + "/endeca \n")
def install_mdex(configData, full_path):
    endecaData = configData[json_key]
    requiredFields = ['installOwner', 'installGroup']
    commerce_setup_helper.check_required_fields(endecaData, requiredFields)
    INSTALL_OWNER = endecaData['installOwner']
    INSTALL_GROUP = endecaData['installGroup']
    if 'mdex' in endecaData:
        jsonData = endecaData['mdex']
        requiredFields = ['endecaRoot']
        commerce_setup_helper.check_required_fields(jsonData, requiredFields)
    else:
        print service_name + " config data missing from json. will not install"
        return

    print "installing " + service_name

    if (platform.system() == "SunOS"):
        binary_path = full_path + "/binaries/endeca11.1/solaris"
        install_exec = "/MDEX_Install/OCmdex6.5.1-Solaris_829811.sh"
    else:
        binary_path = full_path + "/binaries/endeca11.1"
        install_exec = "/MDEX_Install/OCmdex6.5.1-Linux64_829811.sh"

    full_exec_path = binary_path + install_exec

    if not os.path.exists(full_exec_path):
        print "Binary " + full_exec_path + " does not exist - will not install"
        return False

    if jsonData is not None:

        ENDECA_ROOT = jsonData['endecaRoot']
        # make the install tree with correct owner if needed
        commerce_setup_helper.mkdir_with_perms(ENDECA_ROOT, INSTALL_OWNER,
                                               INSTALL_GROUP)

        installCommand = "\"" + full_exec_path + " --target " + ENDECA_ROOT + "\""
        # print "command is " + installCommand
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, installCommand)

        # add bashrc entries
        commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                            "##################### \n")
        commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                            "#Endeca Settings \n")
        commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                            "##################### \n")
        commerce_setup_helper.add_to_bashrc(
            INSTALL_OWNER, "source " + ENDECA_ROOT +
            "/endeca/MDEX/6.5.1/mdex_setup_sh.ini \n")
        commerce_setup_helper.add_to_bashrc(
            INSTALL_OWNER, "export ENDECA_HOME=" + ENDECA_ROOT + "/endeca \n")
示例#4
0
def install_cas(configData, full_path):

    endecaData = configData[json_key]
    requiredFields = ['installOwner', 'installGroup']
    commerce_setup_helper.check_required_fields(endecaData, requiredFields)
    INSTALL_OWNER = endecaData['installOwner']
    INSTALL_GROUP = endecaData['installGroup']
    if service_key in endecaData:
        jsonData = endecaData[service_key]
        requiredFields = [
            'endecaRoot', 'casPort', 'casShutdownPort', 'casHostname'
        ]
        commerce_setup_helper.check_required_fields(jsonData, requiredFields)
    else:
        print service_name + " config data missing from json. will not install"
        return

    print "installing " + service_name

    if (platform.system() == "SunOS"):
        binary_path = full_path + "/binaries/endeca11.1/solaris"
        install_exec = "/CAS_Install/OCcas11.1.0-Solaris.sh"
    else:
        binary_path = full_path + "/binaries/endeca11.1"
        install_exec = "/CAS_Install/OCcas11.1.0-Linux64.sh"

    response_files_path = full_path + "/responseFiles/endeca11.1"

    full_exec_path = binary_path + install_exec

    if not os.path.exists(full_exec_path):
        print "Binary " + full_exec_path + " does not exist - will not install"
        return False

    if jsonData is not None:

        ENDECA_ROOT = jsonData['endecaRoot']
        CAS_PORT = jsonData['casPort']
        CAS_SHUTDOWN_PORT = jsonData['casShutdownPort']
        CAS_HOSTNAME = jsonData['casHostname']
        START_ON_BOOT = jsonData['start_onBoot']
        # make the install tree with correct owner if needed
        commerce_setup_helper.mkdir_with_perms(ENDECA_ROOT, INSTALL_OWNER,
                                               INSTALL_GROUP)

        # data field to replace in our silent installer file
        field_replacements = {
            'ENDECA_ROOT': ENDECA_ROOT,
            'CAS_PORT': CAS_PORT,
            'CAS_SHUTDOWN_PORT': CAS_SHUTDOWN_PORT,
            'CAS_HOST': CAS_HOSTNAME
        }

        commerce_setup_helper.substitute_file_fields(
            response_files_path + '/cas_silent.txt.master',
            response_files_path + '/cas_silent.txt', field_replacements)

        installCommand = "\"" + full_exec_path + " --silent --target " + ENDECA_ROOT + \
        " --endeca_tools_root " + ENDECA_ROOT + "/endeca/ToolsAndFrameworks/11.1.0 --endeca_tools_conf " + ENDECA_ROOT + "/endeca/ToolsAndFrameworks/11.1.0/server/workspace < " + \
        response_files_path + "/cas_silent.txt \""
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, installCommand)

        if (platform.system() == 'SunOS'):
            startStopPath = "/startStopScripts/solaris/bootScripts/"
        else:
            startStopPath = "/startStopScripts/bootScripts/"

        # copy start/stop script
        ENDECA_HOME = ENDECA_ROOT + "/endeca"
        MDEX_SETUP = ENDECA_HOME + "/MDEX/6.5.1/mdex_setup_sh.ini"
        PLATFORM_SETUP = ENDECA_HOME + "/PlatformServices/workspace/setup/installer_sh.ini"
        script_replacements = {
            'ENDECA_PROCESS_OWNER': INSTALL_OWNER,
            'ENDECA_INSTALL_ROOT': ENDECA_HOME,
            "MDEX_SETUP": MDEX_SETUP,
            "PLATFORM_SETUP": PLATFORM_SETUP
        }
        commerce_setup_helper.copy_start_script(
            START_ON_BOOT, full_path + startStopPath + 'endecaCAS.master',
            script_replacements)

        # restart other services before cas
        platformCmd = "/etc/init.d/platformServices"
        toolsCmd = "/etc/init.d/toolsAndFramework"
        commerce_setup_helper.exec_cmd(toolsCmd + " stop")
        commerce_setup_helper.exec_cmd(platformCmd + " restart")
        commerce_setup_helper.exec_cmd(toolsCmd + " start")
        # start cas
        startCmd = "/etc/init.d/endecaCAS"
        commerce_setup_helper.exec_cmd(startCmd + " start")

        commerce_setup_helper.add_to_bashrc(
            INSTALL_OWNER, "# echo Endeca " + service_name +
            " start/stop script: " + startCmd + "\n")
def install_weblogic(configData, full_path): 
    
    if json_key in configData:
        jsonData = configData[json_key]
    else:
        logging.error(json_key + " config data missing from json. will not install")
        return False

    logging.info("installing " + service_name)
    
    binary_path = full_path + "/binaries/wls-12.1.2"
    response_files_path = full_path + "/responseFiles/wls-12.1.2"
    install_exec = "wls_121200.jar"
    full_exec_path = binary_path + "/" + install_exec
    
    if not os.path.exists(full_exec_path):
        logging.error("Binary " + full_exec_path + " does not exist - will not install")
        return False
                    
                    
    requiredFields = ['middlewareHome', 'installOwner', 'installGroup', 'oraInventoryDir']
    commerce_setup_helper.check_required_fields(jsonData, requiredFields)

    INSTALL_DIR = jsonData['middlewareHome']
    INSTALL_OWNER = jsonData['installOwner']
    INSTALL_GROUP = jsonData['installGroup']
    ORACLE_INVENTORY_DIR = jsonData['oraInventoryDir']
    ORA_INST = "/etc/oraInst.loc"
    
    oraInst_replacements = {'ORACLE_INVENTORY_DIR':ORACLE_INVENTORY_DIR, 'ORACLE_INVENTORY_GROUP':INSTALL_GROUP}
    
    # if oraInst.loc doesn't already exist, we need to make one
    if not os.path.isfile(ORA_INST):
        commerce_setup_helper.substitute_file_fields(response_files_path + '/oraInst.loc.master', response_files_path + '/oraInst.loc', oraInst_replacements)
        shutil.copyfile(response_files_path + "/oraInst.loc" , ORA_INST)
        commerce_setup_helper.change_file_owner(ORA_INST, INSTALL_OWNER, INSTALL_GROUP)
        os.chmod(ORA_INST, 0664) 
        
    wl_replacements = {'INSTALL_DIR':INSTALL_DIR}
    commerce_setup_helper.substitute_file_fields(response_files_path + '/install.rsp.master', response_files_path + '/install.rsp', wl_replacements)
    
    # make the install tree with correct owner if needed
    commerce_setup_helper.mkdir_with_perms(INSTALL_DIR, INSTALL_OWNER, INSTALL_GROUP)
        
    # install wl
    if (platform.system() == 'SunOS'):
        installCommand = "\"" + "java -d64 -jar "
    else:
        installCommand = "\"" + "java -jar "
    installCommand = installCommand + full_exec_path + " -silent -invPtrLoc " + ORA_INST + " -responseFile " + response_files_path + "/install.rsp -logfile wlinstall.log" + "\""
    commerce_setup_helper.exec_as_user(INSTALL_OWNER, installCommand)
    
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER, "##################### \n")
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER, "#WebLogic Settings \n")
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER, "##################### \n")
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER, "export MW_HOME=" + INSTALL_DIR + "\n\n")
    
    JAVA_RAND = ""
    # if linux/Solaris, change random, This is faster in some implementations.
    if (platform.system() == "SunOS"):
        JAVA_RAND = "-Djava.security.egd=file:///dev/urandom"
    else:
        JAVA_RAND = "-Djava.security.egd=file:/dev/./urandom"
            
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER, 'export CONFIG_JVM_ARGS=\"' + JAVA_RAND + ' \" \n')
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER, 'export JAVA_OPTIONS=\"' + JAVA_RAND + ' \" \n')    
    
    # install patches if any were listed
    patch_weblogic(configData, full_path)
示例#6
0
def install_oracle(configData, full_path):

    if json_key in configData:
        jsonData = configData[json_key]
    else:
        print json_key + " config data missing from json. will not install"
        return

    print "installing " + service_name

    if (platform.system() == "SunOS"):
        binary_path = full_path + "/binaries/oracleDB12c/solaris"
    else:
        binary_path = full_path + "/binaries/oracleDB12c"

    response_files_path = full_path + "/responseFiles/oracle12c"

    install_exec = "/database/runInstaller"
    full_exec_path = binary_path + install_exec

    if not os.path.exists(full_exec_path):
        print "Binary " + full_exec_path + " does not exist - will not install"
        return False

    requiredFields = [
        'oracleBase', 'installOwner', 'installGroup', 'installHost',
        'oraInventoryDir', 'oracleHome', 'oracleSID', 'pdbName', 'adminPW',
        'dbStorageLoc'
    ]
    commerce_setup_helper.check_required_fields(jsonData, requiredFields)

    ORACLE_BASE = jsonData['oracleBase']
    INSTALL_OWNER = jsonData['installOwner']
    INSTALL_GROUP = jsonData['installGroup']
    INSTALL_HOST = jsonData['installHost']
    ORACLE_INVENTORY_DIR = jsonData['oraInventoryDir']
    ORACLE_HOME = jsonData['oracleHome']
    ORACLE_SID = jsonData['oracleSID']
    PDB_NAME = jsonData['pdbName']
    ORACLE_PW = jsonData['adminPW']
    DB_FILE_DIR = jsonData['dbStorageLoc']
    ORACLE_BOOT = jsonData['db_onBoot']

    oracle_replacements = {
        'BASE_DIR': ORACLE_BASE,
        'IGROUP': INSTALL_GROUP,
        'INSTALL_HOST': INSTALL_HOST,
        'INVENTORY_DIR': ORACLE_INVENTORY_DIR,
        'PRODUCT_HOME': ORACLE_HOME,
        'GLOBAL_DBNAME': ORACLE_SID,
        'PDB_NAME': PDB_NAME,
        'ORA_PW': ORACLE_PW,
        'DB_FILE_DIR': DB_FILE_DIR,
    }

    commerce_setup_helper.substitute_file_fields(
        response_files_path + '/db.rsp.master',
        response_files_path + '/db.rsp', oracle_replacements)
    commerce_setup_helper.substitute_file_fields(
        response_files_path + '/dbca.rsp.master',
        response_files_path + '/dbca.rsp', oracle_replacements)

    # make the install trees with correct owner if needed
    commerce_setup_helper.mkdir_with_perms(ORACLE_BASE, INSTALL_OWNER,
                                           INSTALL_GROUP)
    commerce_setup_helper.mkdir_with_perms(ORACLE_INVENTORY_DIR, INSTALL_OWNER,
                                           INSTALL_GROUP)
    commerce_setup_helper.mkdir_with_perms(ORACLE_HOME, INSTALL_OWNER,
                                           INSTALL_GROUP)
    commerce_setup_helper.mkdir_with_perms(DB_FILE_DIR, INSTALL_OWNER,
                                           INSTALL_GROUP)

    # install db
    installCommand = "\"" + full_exec_path + " -silent -waitforcompletion -responseFile " + response_files_path + "/db.rsp" + "\""
    commerce_setup_helper.exec_as_user(INSTALL_OWNER, installCommand)

    invCmd = ORACLE_INVENTORY_DIR + "/orainstRoot.sh"
    commerce_setup_helper.exec_cmd(invCmd)

    rootCmd = ORACLE_HOME + "/root.sh"
    commerce_setup_helper.exec_cmd(rootCmd)

    postInstallCmd = "\"" + ORACLE_HOME + "/cfgtoollogs/configToolAllCommands RESPONSE_FILE=" + response_files_path + "/db.rsp" + "\""
    commerce_setup_helper.exec_as_user(INSTALL_OWNER, postInstallCmd)

    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                        "##################### \n")
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER, "#Oracle Settings \n")
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                        "##################### \n")
    commerce_setup_helper.add_to_bashrc(
        INSTALL_OWNER, "export ORACLE_HOME=" + ORACLE_HOME + "\n")
    commerce_setup_helper.add_to_bashrc(
        INSTALL_OWNER, "export ORACLE_SID=" + ORACLE_SID + "\n")
    commerce_setup_helper.add_to_bashrc(
        INSTALL_OWNER, "export PATH=$PATH:" + ORACLE_HOME + "/bin \n")

    # copy start/stop script
    script_replacements = {
        'ORACLE_HOME': ORACLE_HOME,
        'ORACLE_PROCESS_OWNER': INSTALL_OWNER
    }
    commerce_setup_helper.copy_start_script(
        ORACLE_BOOT,
        full_path + '/startStopScripts/bootScripts/oracleDatabase.master',
        script_replacements)
    # commerce_setup_helper.copy_start_script(ORACLE_BOOT, full_path + '/startStopScripts/bootScripts/oracleDBconsole.master', script_replacements)

    commerce_setup_helper.add_to_bashrc(
        INSTALL_OWNER, "# echo " + service_name +
        " start/stop script: /etc/init.d/oracleDatabase \n")
    # not used for 12c install - using em express instead
    # commerce_setup_helper.add_to_bashrc(INSTALL_OWNER, "# echo database console start/stop script: /etc/init.d/oracleDBconsole \n\n")

    install_listener(INSTALL_OWNER, ORACLE_HOME, response_files_path)

    install_sampledb(INSTALL_OWNER, ORACLE_HOME, response_files_path)

    if (platform.system() == "SunOS"):
        oratab_file = "/var/opt/oracle/oratab"
    else:
        oratab_file = "/etc/oratab"

    # set our DB to autostart in the future
    line_to_replace = ORACLE_SID + ":" + ORACLE_HOME + ":" "N"
    replace_with = ORACLE_SID + ":" + ORACLE_HOME + ":" "Y"

    for line in fileinput.input(oratab_file, inplace=True):
        print line.rstrip().replace(line_to_replace, replace_with)
示例#7
0
def create_wl_domain(configData, full_path): 
    
    if json_key in configData:
        jsonData = configData[json_key]
    else:
        logging.error(json_key + " config data missing from json. will not install")
        return

    if common_key in configData:
        commonData = configData[common_key]
    else:
        logging.error(common_key + " config data missing from json. will not install")
        return   

    response_files_path = full_path + "/responseFiles/wls-12.2.1"
                    
    logging.info("Creating " + service_name)               
     
    commonRequiredFields = ['middlewareHome', 'installOwner', 'wl_domain', 'wl_adminHttpPort', 'wl_adminHttpsPort', 'wl_adminPassword']
    commerce_setup_helper.check_required_fields(commonData, commonRequiredFields)
    
    requiredFields = ['wl_startAdmin_onBoot', 'wl_startNodemgr_onBoot']
    commerce_setup_helper.check_required_fields(jsonData, requiredFields)    

    INSTALL_DIR = commonData['middlewareHome']
    INSTALL_OWNER = commonData['installOwner']
    WL_DOMAIN_NAME = commonData['wl_domain']
    WL_ADMIN_HTTP_PORT = commonData['wl_adminHttpPort']
    WL_ADMIN_HTTPS_PORT = commonData['wl_adminHttpsPort']
    WL_ADMIN_PW = commonData['wl_adminPassword']
    WL_ADMIN_BOOT = jsonData['wl_startAdmin_onBoot']
    WL_NODE_BOOT = jsonData['wl_startNodemgr_onBoot']

    WL_MACHINES = add_machines(configData, full_path)
    WL_MANAGED_SERVERS = add_managed_servers(configData, full_path)

    wlst_path = INSTALL_DIR + "/oracle_common/common/bin/wlst.sh"
    
    if not os.path.exists(wlst_path):
        logging.error("Binary " + wlst_path + " does not exist - will not install")
        return False   
        
    wl_replacements = {'INSTALL_DIR':INSTALL_DIR, 'WL_DOMAIN_NAME':WL_DOMAIN_NAME, 'WL_ADMIN_HTTP_PORT':WL_ADMIN_HTTP_PORT, 'WL_ADMIN_HTTPS_PORT':WL_ADMIN_HTTPS_PORT, 'WL_ADMIN_PW':WL_ADMIN_PW, 'WL_MANAGED_SERVERS':WL_MANAGED_SERVERS, 'WL_MACHINES':WL_MACHINES}
    commerce_setup_helper.substitute_file_fields(response_files_path + '/basicWLSDomain.py.master', response_files_path + '/basicWLSDomain.py', wl_replacements)

    domainCmd = "\""
    
    JAVA_RAND = ""
    # if linux/Solaris, change random, This is faster in some implementations.
    if (platform.system() == "SunOS"):
        JAVA_RAND = "-Djava.security.egd=file:///dev/urandom"
    else:
        JAVA_RAND = "-Djava.security.egd=file:/dev/./urandom"
        
    # create wl domain CONFIG_JVM_ARGS
    domainCmd += "export CONFIG_JVM_ARGS='" + JAVA_RAND + "'; "
    domainCmd += wlst_path + " " + response_files_path + "/basicWLSDomain.py " + "\""
    commerce_setup_helper.exec_as_user(INSTALL_OWNER, domainCmd)  
   
    if (platform.system() == 'SunOS'):
        startStopPath = "/startStopScripts/solaris/bootScripts/"
    else:
        startStopPath = "/startStopScripts/bootScripts/"
   
    # copy start/stop script
    WL_DOMAIN_HOME = INSTALL_DIR + '/user_projects/domains/' + WL_DOMAIN_NAME
    wlScript_replacements = {'WL_DOMAIN_HOME':WL_DOMAIN_HOME, "WL_PROCESS_OWNER":INSTALL_OWNER}
    commerce_setup_helper.copy_start_script(WL_ADMIN_BOOT, full_path + startStopPath + 'weblogicAdmin.master', wlScript_replacements)
    commerce_setup_helper.copy_start_script(WL_NODE_BOOT, full_path + startStopPath + 'weblogicNodemgr.master', wlScript_replacements)
    
    # pack the domain for managed servers
    weblogic_packer.pack_domain(configData, full_path)
    
    # fire up the admin server and nodemgr 
    startWLCmd = "/etc/init.d/weblogicAdmin"
    commerce_setup_helper.exec_cmd(startWLCmd + " start")
    startNodeCmd = "/etc/init.d/weblogicNodemgr"
    commerce_setup_helper.exec_cmd(startNodeCmd + " start")
    
    # give admin server time to finish starting
    sleepTime = 60
    time.sleep(sleepTime)
    
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER, "# echo 'WebLogic Admin start/stop script: '" + startWLCmd + "\n")    
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER, "# echo 'WebLogic NodeManager start/stop script: '" + startNodeCmd + "\n")   
示例#8
0
def install_atg(configData, full_path):

    if json_key in configData:
        jsonData = configData[json_key]
    else:
        logging.error(json_key +
                      " config data missing from json. will not install")
        return False

    logging.info("installing " + service_name)
    binary_path = full_path + "/binaries/atg11.3"
    response_files_path = full_path + "/responseFiles/atg11.3"
    install_exec = "/linux/OCPlatform11.3.bin"
    full_exec_path = binary_path + install_exec

    if not os.path.exists(full_exec_path):
        logging.error("Binary " + full_exec_path +
                      " does not exist - will not install")
        return False

    requiredFields = [
        'dynamoRoot', 'installOwner', 'installGroup', 'rmiPort', 'javaHome',
        'wl_home', 'wl_domain', 'wl_adminPort', 'install_crs', 'install_csa'
    ]
    commerce_setup_helper.check_required_fields(jsonData, requiredFields)

    INSTALL_DIR = jsonData['dynamoRoot']
    INSTALL_OWNER = jsonData['installOwner']
    INSTALL_GROUP = jsonData['installGroup']
    RMI_PORT = jsonData['rmiPort']
    JAVA_DIR = jsonData['javaHome']
    WL_HOME = jsonData['wl_home']
    WL_DOMAIN = jsonData['wl_domain']
    WL_ADMIN_PORT = jsonData['wl_adminPort']
    INSTALL_CRS = jsonData['install_crs']
    INSTALL_CSA = jsonData['install_csa']
    INSTALL_SERVICE = jsonData['install_service']

    field_replacements = {
        'INSTALL_HOME': INSTALL_DIR,
        'WEBLOGIC_HOME': WL_HOME,
        'WEBLOGIC_DOMAIN': WL_DOMAIN,
        'WEBLOGIC_ADMIN_PORT': WL_ADMIN_PORT,
        'ATGRMI_PORT': RMI_PORT,
        'JDK_PATH': JAVA_DIR
    }
    commerce_setup_helper.substitute_file_fields(
        response_files_path + '/linux/installer.properties.master',
        response_files_path + '/linux/installer.properties',
        field_replacements)

    # make the install tree with correct owner if needed
    commerce_setup_helper.mkdir_with_perms(INSTALL_DIR, INSTALL_OWNER,
                                           INSTALL_GROUP)

    installCommand = "\"" + full_exec_path + " -i silent -f " + response_files_path + "/linux/installer.properties" + "\""
    commerce_setup_helper.exec_as_user(INSTALL_OWNER, installCommand)

    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                        "##################### \n")
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER, "#ATG Settings \n")
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                        "##################### \n")
    commerce_setup_helper.add_to_bashrc(
        INSTALL_OWNER, "export DYNAMO_ROOT=" + INSTALL_DIR + "\n")
    commerce_setup_helper.add_to_bashrc(
        INSTALL_OWNER, "export DYNAMO_HOME=$DYNAMO_ROOT/home \n\n")

    if (INSTALL_CRS == "true"):
        logging.info("installing CRS")
        crs_exec_path = binary_path + "/crs/OCReferenceStore11.3.bin"
        if not os.path.exists(crs_exec_path):
            logging.error("Binary " + crs_exec_path +
                          " does not exist - will not install")
            return False
        field_replacements = {'INSTALL_HOME': INSTALL_DIR}
        commerce_setup_helper.substitute_file_fields(
            response_files_path + '/crs/crsinstaller.properties.master',
            response_files_path + '/crs/crsinstaller.properties',
            field_replacements)
        installCommand = "\"" + crs_exec_path + " -i silent -f " + response_files_path + "/crs/crsinstaller.properties" + "\""
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, installCommand)

    if (INSTALL_CSA == "true"):
        logging.info("installing CSA")
        csa_exec_path = binary_path + "/csa/OCStoreAccelerator11.3.bin"
        if not os.path.exists(csa_exec_path):
            logging.error("Binary " + csa_exec_path +
                          " does not exist - will not install")
            return False
        field_replacements = {'INSTALL_HOME': INSTALL_DIR}
        commerce_setup_helper.substitute_file_fields(
            response_files_path + '/csa/csainstaller.properties.master',
            response_files_path + '/csa/csainstaller.properties',
            field_replacements)
        installCommand = "\"" + csa_exec_path + " -i silent -f " + response_files_path + "/csa/csainstaller.properties" + "\""
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, installCommand)

    if (INSTALL_SERVICE == "true"):

        logging.info("installing Service")

        service_exec_path = binary_path + "/service/OCServiceCenter11.3.bin"
        if not os.path.exists(service_exec_path):
            logging.error("Binary " + service_exec_path +
                          " does not exist - will not install")
            return

        field_replacements = {'INSTALL_HOME': INSTALL_DIR}
        commerce_setup_helper.substitute_file_fields(
            response_files_path +
            '/service/serviceinstaller.properties.master',
            response_files_path + '/service/serviceinstaller.properties',
            field_replacements)
        installCommand = "\"" + service_exec_path + " -i silent -f " + response_files_path + "/service/serviceinstaller.properties" + "\""
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, installCommand)
示例#9
0
def install_atg(configData, full_path):

    if json_key in configData:
        jsonData = configData[json_key]
    else:
        print json_key + " config data missing from json. will not install"
        return False

    print "installing " + service_name

    binary_path = full_path + "/binaries/atg11.1"
    response_files_path = full_path + "/responseFiles/atg11.1"
    install_exec = "/linux/OCPlatform11.1.bin"
    full_exec_path = binary_path + install_exec

    if not os.path.exists(full_exec_path):
        print "Binary " + full_exec_path + " does not exist - will not install"
        return False

    requiredFields = [
        'dynamoRoot', 'installOwner', 'installGroup', 'rmiPort', 'javaHome',
        'wl_home', 'wl_domain', 'wl_adminPort', 'install_crs'
    ]
    commerce_setup_helper.check_required_fields(jsonData, requiredFields)

    INSTALL_DIR = jsonData['dynamoRoot']
    INSTALL_OWNER = jsonData['installOwner']
    INSTALL_GROUP = jsonData['installGroup']
    RMI_PORT = jsonData['rmiPort']
    JAVA_DIR = jsonData['javaHome']
    WL_HOME = jsonData['wl_home']
    WL_DOMAIN = jsonData['wl_domain']
    WL_ADMIN_PORT = jsonData['wl_adminPort']
    INSTALL_CRS = jsonData['install_crs']
    INSTALL_SERVICE = jsonData['install_service']

    field_replacements = {
        'INSTALL_HOME': INSTALL_DIR,
        'WEBLOGIC_HOME': WL_HOME,
        'WEBLOGIC_DOMAIN': WL_DOMAIN,
        'WEBLOGIC_ADMIN_PORT': WL_ADMIN_PORT,
        'ATGRMI_PORT': RMI_PORT,
        'JDK_PATH': JAVA_DIR
    }
    commerce_setup_helper.substitute_file_fields(
        response_files_path + '/linux/installer.properties.master',
        response_files_path + '/linux/installer.properties',
        field_replacements)

    # make the install tree with correct owner if needed
    commerce_setup_helper.mkdir_with_perms(INSTALL_DIR, INSTALL_OWNER,
                                           INSTALL_GROUP)

    installCommand = "\"" + full_exec_path + " -i silent -f " + response_files_path + "/linux/installer.properties" + "\""
    commerce_setup_helper.exec_as_user(INSTALL_OWNER, installCommand)

    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                        "##################### \n")
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER, "#ATG Settings \n")
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                        "##################### \n")
    commerce_setup_helper.add_to_bashrc(
        INSTALL_OWNER, "export DYNAMO_ROOT=" + INSTALL_DIR + "\n")
    commerce_setup_helper.add_to_bashrc(
        INSTALL_OWNER, "export DYNAMO_HOME=$DYNAMO_ROOT/home \n\n")

    if (INSTALL_CRS == "true"):

        print "installing CRS"

        crs_exec_path = binary_path + "/crs/OCReferenceStore11.1.bin"
        if not os.path.exists(crs_exec_path):
            print "Binary " + crs_exec_path + " does not exist - will not install"
            return

        field_replacements = {'INSTALL_HOME': INSTALL_DIR}
        commerce_setup_helper.substitute_file_fields(
            response_files_path + '/crs/crsinstaller.properties.master',
            response_files_path + '/crs/crsinstaller.properties',
            field_replacements)
        installCommand = "\"" + crs_exec_path + " -i silent -f " + response_files_path + "/crs/crsinstaller.properties" + "\""
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, installCommand)

        # If patch1 is installed, these are not updated. fix it.
        cpCmd = "\"" + "cp " + INSTALL_DIR + "/DAS/taglib/dspjspTaglib/1.0/lib/dspjspTaglib1_0.jar " + INSTALL_DIR + "/CommerceReferenceStore/Store/Storefront/j2ee-apps/Storefront/store.war/WEB-INF/lib" + "\""
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, cpCmd)
        cpCmd = "\"" + "cp " + INSTALL_DIR + "/DAS/taglib/dspjspTaglib/1.0/lib/dspjspTaglib1_0.jar " + INSTALL_DIR + "/CommerceReferenceStore/Store/Storefront/j2ee-apps/Storefront/storedocroot.war/WEB-INF/lib" + "\""
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, cpCmd)
        cpCmd = "\"" + "cp " + INSTALL_DIR + "/DAS/taglib/dspjspTaglib/1.0/lib/dspjspTaglib1_0.jar " + INSTALL_DIR + "/CommerceReferenceStore/Store/Fluoroscope/j2ee-apps/Fluoroscope/fluoroscope.war/WEB-INF/lib" + "\""
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, cpCmd)
        cpCmd = "\"" + "cp " + INSTALL_DIR + "/DAS/taglib/dspjspTaglib/1.0/lib/dspjspTaglib1_0.jar " + INSTALL_DIR + "/CommerceReferenceStore/Store/DCS-CSR/j2ee-apps/DCS-CSR/CSRHelper.war/WEB-INF/lib" + "\""
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, cpCmd)
        cpCmd = "\"" + "cp " + INSTALL_DIR + "/DAS/taglib/dspjspTaglib/1.0/lib/dspjspTaglib1_0.jar " + INSTALL_DIR + "/CommerceReferenceStore/Store/EStore/Versioned/j2ee-apps/Versioned/store-merchandising.war/WEB-INF/lib" + "\""
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, cpCmd)

    if (INSTALL_SERVICE == "true"):

        print "installing Service"

        service_exec_path = binary_path + "/service/OCServiceCenter11.1.bin"
        if not os.path.exists(service_exec_path):
            print "Binary " + service_exec_path + " does not exist - will not install"
            return

        field_replacements = {'INSTALL_HOME': INSTALL_DIR}
        commerce_setup_helper.substitute_file_fields(
            response_files_path +
            '/service/serviceinstaller.properties.master',
            response_files_path + '/service/serviceinstaller.properties',
            field_replacements)
        installCommand = "\"" + service_exec_path + " -i silent -f " + response_files_path + "/service/serviceinstaller.properties" + "\""
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, installCommand)
示例#10
0
def install_toolsAndFramework(configData, full_path):

    endecaData = configData[json_key]
    requiredFields = ['installOwner', 'installGroup']
    commerce_setup_helper.check_required_fields(endecaData, requiredFields)
    INSTALL_OWNER = endecaData['installOwner']
    INSTALL_GROUP = endecaData['installGroup']
    if 'toolsAndFramework' in endecaData:
        jsonData = endecaData['toolsAndFramework']
        requiredFields = ['endecaRoot']
        commerce_setup_helper.check_required_fields(jsonData, requiredFields)
    else:
        logging.error(service_name +
                      " config data missing from json. will not install")
        return

    logging.info("installing " + service_name)

    if (platform.system() == "SunOS"):
        binary_path = full_path + "/binaries/endeca11.3/solaris"
    else:
        binary_path = full_path + "/binaries/endeca11.3"

    install_exec = "/ToolsAndFrameworkInstall/Disk1/install/silent_install.sh"

    response_files_path = full_path + "/responseFiles/endeca11.3"

    full_exec_path = binary_path + install_exec

    if not os.path.exists(full_exec_path):
        logging.error("Binary " + full_exec_path +
                      " does not exist - will not install")
        return False

    if jsonData is not None:
        ENDECA_ROOT = jsonData['endecaRoot']
        START_ON_BOOT = jsonData['start_onBoot']
        # make the install tree with correct owner if needed
        commerce_setup_helper.mkdir_with_perms(ENDECA_ROOT, INSTALL_OWNER,
                                               INSTALL_GROUP)

        # data field to replace in our silent installer file
        field_replacements = {
            'ENDECA_ROOT': ENDECA_ROOT,
            'ENDECA_GROUP': INSTALL_GROUP
        }

        commerce_setup_helper.substitute_file_fields(
            response_files_path + '/tools_response.rsp.master',
            response_files_path + '/tools_response.rsp', field_replacements)

        installCommand = "\"" + full_exec_path + " " + \
        response_files_path + "/tools_response.rsp ToolsAndFrameworks " + \
        ENDECA_ROOT + "/endeca/ToolsAndFrameworks "

        if 'oraInventoryDir' in jsonData:
            installCommand = installCommand + jsonData['oraInventoryDir']

        commerce_setup_helper.exec_as_user(INSTALL_OWNER,
                                           installCommand + "\"")

        # copy start/stop script
        ENDECA_HOME = ENDECA_ROOT + "/endeca"
        MDEX_SETUP = ENDECA_HOME + "/MDEX/11.3.0/mdex_setup_sh.ini"
        PLATFORM_SETUP = ENDECA_HOME + "/PlatformServices/workspace/setup/installer_sh.ini"
        script_replacements = {
            'ENDECA_PROCESS_OWNER': INSTALL_OWNER,
            'ENDECA_INSTALL_ROOT': ENDECA_HOME,
            "MDEX_SETUP": MDEX_SETUP,
            "PLATFORM_SETUP": PLATFORM_SETUP,
            "INSTALL_VERSION": endeca_version
        }
        commerce_setup_helper.copy_start_script(
            START_ON_BOOT, full_path +
            '/startStopScripts/bootScripts/toolsAndFramework.master',
            script_replacements)

        # fire up the server
        startCmd = "/etc/init.d/toolsAndFramework"
        commerce_setup_helper.exec_cmd(startCmd + " start")

        commerce_setup_helper.add_to_bashrc(
            INSTALL_OWNER, "# echo Endeca " + service_name +
            " start/stop script: " + startCmd + "\n")
示例#11
0
def install_platformServices(configData, full_path):

    endecaData = configData[json_key]
    requiredFields = ['installOwner', 'installGroup']
    commerce_setup_helper.check_required_fields(endecaData, requiredFields)
    INSTALL_OWNER = endecaData['installOwner']
    INSTALL_GROUP = endecaData['installGroup']
    if 'platformServices' in endecaData:
        jsonData = endecaData['platformServices']
        requiredFields = [
            'endecaRoot', 'eacPort', 'eacShutdownPort', 'mdexRoot'
        ]
        commerce_setup_helper.check_required_fields(jsonData, requiredFields)
    else:
        logging.error(service_name +
                      " config data missing from json. will not install")
        return

    logging.info("installing " + service_name)

    if (platform.system() == "SunOS"):
        binary_path = full_path + "/binaries/endeca11.3/solaris"
        install_exec = "/Platform_Install/OCplatformservices11.3.0-Solaris.bin"
    else:
        binary_path = full_path + "/binaries/endeca11.3"
        install_exec = "/Platform_Install/OCplatformservices11.3.0-Linux64.bin"

    response_files_path = full_path + "/responseFiles/endeca11.3"

    full_exec_path = binary_path + install_exec

    if not os.path.exists(full_exec_path):
        logging.error("Binary " + full_exec_path +
                      " does not exist - will not install")
        return False

    if jsonData is not None:
        ENDECA_ROOT = jsonData['endecaRoot']
        MDEX_ROOT = jsonData['mdexRoot']
        EAC_PORT = jsonData['eacPort']
        EAC_SHUTDOWN_PORT = jsonData['eacShutdownPort']
        START_ON_BOOT = jsonData['start_onBoot']
        # make the install tree with correct owner if needed
        commerce_setup_helper.mkdir_with_perms(ENDECA_ROOT, INSTALL_OWNER,
                                               INSTALL_GROUP)

        # data field to replace in our silent installer file
        field_replacements = {
            'INSTALLATION_DIR': ENDECA_ROOT,
            'MDEX_INST_ROOT': MDEX_ROOT,
            'EAC_PORT': EAC_PORT,
            'EAC_SHUTDOWN_PORT': EAC_SHUTDOWN_PORT
        }

        commerce_setup_helper.substitute_file_fields(
            response_files_path + '/platform_response.rsp.master',
            response_files_path + '/platform_response.rsp', field_replacements)

        installCommand = "\"" + full_exec_path + " -i silent -f " + response_files_path + '/platform_response.rsp' + "\""
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, installCommand)

        # add bashrc entries
        commerce_setup_helper.add_to_bashrc(
            INSTALL_OWNER, "source " + ENDECA_ROOT +
            "/endeca/PlatformServices/workspace/setup/installer_sh.ini \n")

        # copy start/stop script
        ENDECA_HOME = ENDECA_ROOT + "/endeca"
        MDEX_SETUP = MDEX_ROOT + "/mdex_setup_sh.ini"
        PLATFORM_SETUP = ENDECA_HOME + "/PlatformServices/workspace/setup/installer_sh.ini"
        script_replacements = {
            'ENDECA_PROCESS_OWNER': INSTALL_OWNER,
            'ENDECA_INSTALL_ROOT': ENDECA_HOME,
            "MDEX_SETUP": MDEX_SETUP,
            "PLATFORM_SETUP": PLATFORM_SETUP,
            "INSTALL_VERSION": endeca_version
        }
        commerce_setup_helper.copy_start_script(
            START_ON_BOOT, full_path +
            '/startStopScripts/bootScripts/platformServices.master',
            script_replacements)

        # fire up the server
        startCmd = "/etc/init.d/platformServices"
        commerce_setup_helper.exec_cmd(startCmd + " start")

        commerce_setup_helper.add_to_bashrc(
            INSTALL_OWNER, "# echo Endeca " + service_name +
            " start/stop script: " + startCmd + "\n")
示例#12
0
def install_otd(configData, full_path):

    if json_key in configData:
        jsonData = configData[json_key]
    else:
        print json_key + " config data missing from json. will not install"
        return False

    print "installing " + service_name

    if (platform.system() == "SunOS"):
        binary_path = full_path + "/binaries/OTD11.1.1.9/solaris"
    else:
        binary_path = full_path + "/binaries/OTD11.1.1.9"

    install_exec = "/Disk1/runInstaller"

    response_files_path = full_path + "/responseFiles/OTD11"

    full_exec_path = binary_path + install_exec

    if not os.path.exists(full_exec_path):
        print "Binary " + full_exec_path + " does not exist - will not install"
        return False

    requiredFields = [
        'instanceHome', 'installDir', 'adminUser', 'installOwner',
        'adminPassword', 'oraInventoryDir'
    ]
    commerce_setup_helper.check_required_fields(jsonData, requiredFields)

    INSTALL_OWNER = jsonData['installOwner']
    INSTANCE_HOME = jsonData['instanceHome']
    INSTALL_DIR = jsonData['installDir']
    ORACLE_INVENTORY_DIR = jsonData['oraInventoryDir']
    ORACLE_INVENTORY_GROUP = jsonData['oraInventoryGroup']
    ADMIN_USER = jsonData['adminUser']
    ADMIN_PASSWORD = jsonData['adminPassword']
    OTD_ADMIN_BOOT = jsonData['otd_startAdmin_onBoot']
    ORA_INST = "/etc/oraInst.loc"
    OTD_INSTANCE_NAME = "admin-server"

    oraInst_replacements = {
        'ORACLE_INVENTORY_DIR': ORACLE_INVENTORY_DIR,
        'ORACLE_INVENTORY_GROUP': ORACLE_INVENTORY_GROUP
    }
    otdPassword_replacements = {'TADM_ADMINPASSWORD': ADMIN_PASSWORD}

    # if oraInst.loc doesn't already exist, we need to make one
    if not os.path.isfile(ORA_INST):
        commerce_setup_helper.substitute_file_fields(
            response_files_path + '/oraInst.loc.master',
            response_files_path + '/oraInst.loc', oraInst_replacements)
        shutil.copyfile(response_files_path + "/oraInst.loc", ORA_INST)
        commerce_setup_helper.change_file_owner(ORA_INST, INSTALL_OWNER,
                                                ORACLE_INVENTORY_GROUP)
        os.chmod(ORA_INST, 0664)

    # make the install tree with correct owner if needed
    commerce_setup_helper.mkdir_with_perms(INSTALL_DIR, INSTALL_OWNER,
                                           ORACLE_INVENTORY_GROUP)

    # exec the install command
    installCommand = "\"" + binary_path + "/Disk1/runInstaller -silent -waitforcompletion -invPtrLoc /etc/oraInst.loc ORACLE_HOME=" + INSTALL_DIR + " SKIP_SOFTWARE_UPDATES=true\""
    commerce_setup_helper.exec_as_user(INSTALL_OWNER, installCommand)

    # setup password file
    commerce_setup_helper.substitute_file_fields(
        response_files_path + '/otdPassword.pwd.master',
        response_files_path + '/otdPassword.pwd', otdPassword_replacements)

    # exec base admin server creation
    configCommand = "\"" + INSTALL_DIR + "/bin/tadm configure-server --user="******" --instance-home=" + INSTANCE_HOME + " --password-file=" + response_files_path + "/otdPassword.pwd\""
    commerce_setup_helper.exec_as_user(INSTALL_OWNER, configCommand)

    if (platform.system() == 'SunOS'):
        startStopPath = "/startStopScripts/solaris/bootScripts/"
    else:
        startStopPath = "/startStopScripts/bootScripts/"

    # copy start/stop script
    otdScript_replacements = {
        'OTD_PROCESS_OWNER': INSTALL_OWNER,
        'OTD_INSTANCE_HOME': INSTANCE_HOME,
        'OTD_INSTANCE_NAME': OTD_INSTANCE_NAME
    }
    commerce_setup_helper.copy_start_script(
        OTD_ADMIN_BOOT, full_path + startStopPath + 'OTDAdmin.master',
        otdScript_replacements)

    # fire up the otd admin server
    startCmd = "/etc/init.d/OTDAdmin"
    commerce_setup_helper.exec_cmd(startCmd + " start")

    commerce_setup_helper.add_to_bashrc(
        INSTALL_OWNER,
        "# echo " + service_name + " start/stop script: " + startCmd + "\n\n")
示例#13
0
def install_weblogic(configData, full_path):

    if json_key in configData:
        jsonData = configData[json_key]
    else:
        print json_key + " config data missing from json. will not install"
        return

    print "installing " + service_name

    binary_path = full_path + "/binaries/wls-12.1.3"
    response_files_path = full_path + "/responseFiles/wls-12.1.3"
    install_exec = "fmw_12.1.3.0.0_wls.jar"
    full_exec_path = binary_path + "/" + install_exec

    if not os.path.exists(full_exec_path):
        print "Binary " + full_exec_path + " does not exist - will not install"
        return False

    requiredFields = [
        'middlewareHome', 'installOwner', 'installGroup', 'oraInventoryDir'
    ]
    commerce_setup_helper.check_required_fields(jsonData, requiredFields)

    INSTALL_DIR = jsonData['middlewareHome']
    INSTALL_OWNER = jsonData['installOwner']
    INSTALL_GROUP = jsonData['installGroup']
    ORACLE_INVENTORY_DIR = jsonData['oraInventoryDir']
    ORA_INST = "/etc/oraInst.loc"

    oraInst_replacements = {
        'ORACLE_INVENTORY_DIR': ORACLE_INVENTORY_DIR,
        'ORACLE_INVENTORY_GROUP': INSTALL_GROUP
    }

    # if oraInst.loc doesn't already exist, we need to make one
    if not os.path.isfile(ORA_INST):
        commerce_setup_helper.substitute_file_fields(
            response_files_path + '/oraInst.loc.master',
            response_files_path + '/oraInst.loc', oraInst_replacements)
        shutil.copyfile(response_files_path + "/oraInst.loc", ORA_INST)
        commerce_setup_helper.change_file_owner(ORA_INST, INSTALL_OWNER,
                                                INSTALL_GROUP)
        os.chmod(ORA_INST, 0664)

    wl_replacements = {'INSTALL_DIR': INSTALL_DIR}
    commerce_setup_helper.substitute_file_fields(
        response_files_path + '/install.rsp.master',
        response_files_path + '/install.rsp', wl_replacements)

    # make the install tree with correct owner if needed
    commerce_setup_helper.mkdir_with_perms(INSTALL_DIR, INSTALL_OWNER,
                                           INSTALL_GROUP)

    # install wl
    if (platform.system() == 'SunOS'):
        installCommand = "\"" + "java -d64 -jar "
    else:
        installCommand = "\"" + "java -jar "
    installCommand = installCommand + full_exec_path + " -silent -invPtrLoc " + ORA_INST + " -responseFile " + response_files_path + "/install.rsp -logfile wlinstall.log" + "\""
    commerce_setup_helper.exec_as_user(INSTALL_OWNER, installCommand)

    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                        "##################### \n")
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER, "#WebLogic Settings \n")
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                        "##################### \n")
    commerce_setup_helper.add_to_bashrc(
        INSTALL_OWNER, "export MW_HOME=" + INSTALL_DIR + "\n\n")

    # install patches if any were listed
    patch_weblogic(configData, full_path)
示例#14
0
def install_java(configData, full_path):

    if json_key in configData:
        jsonData = configData[json_key]
    else:
        logging.error(service_name +
                      " config data missing from json. will not install")
        return

    if installer_key in configData:
        installerData = configData[installer_key]
    else:
        logging.error("installer data missing. Cannot continue")
        return

    logging.info("installing " + service_name)

    config = ConfigParser.ConfigParser()
    installer_props = installerData['installer_properties']
    config_file = full_path + '/' + installer_props

    if (not os.path.exists(config_file)):
        logging.error("Cannot load installer config data. Halting")
    logging.info("config file is " + config_file)
    config.read(config_file)
    rel_path = config.get(service_name, 'java_binary')
    java_version = config.get(service_name, 'java_version')
    binary_path = full_path + '/' + rel_path

    requiredFields = ['javaHome', 'installOwner', 'installGroup']
    commerce_setup_helper.check_required_fields(jsonData, requiredFields)
    INSTALL_OWNER = jsonData['installOwner']
    INSTALL_GROUP = jsonData['installGroup']
    JAVA_HOME = jsonData['javaHome']

    commerce_setup_helper.mkdir_with_perms(JAVA_HOME, INSTALL_OWNER,
                                           INSTALL_GROUP)

    # solaris setup is different
    if (platform.system() == "SunOS"):
        installCommand = "\"" + "cd " + JAVA_HOME + "; tar zxf " + binary_path + "\""
    else:
        installCommand = "\"" + "tar zxf " + binary_path + " -C " + JAVA_HOME + "\""

    linkCommand = "\"" + "ln -sf " + JAVA_HOME + "/" + java_version + " " + JAVA_HOME + "/latest" + "\""

    commerce_setup_helper.exec_as_user(INSTALL_OWNER, installCommand)

    if (os.path.exists(JAVA_HOME + "/latest")
            or os.path.islink(JAVA_HOME + "/latest")):
        os.remove(JAVA_HOME + "/latest")
    os.symlink(JAVA_HOME + "/" + java_version, JAVA_HOME + "/latest")

    # commerce_setup_helper.exec_as_user(INSTALL_OWNER, linkCommand)
    if (platform.system() != "SunOS"):
        if (os.path.exists('/usr/bin/java')
                or os.path.islink('/usr/bin/java')):
            os.remove('/usr/bin/java')
        os.symlink(JAVA_HOME + '/latest/bin/java', '/usr/bin/java')

    # add bashrc entries
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                        "##################### \n")
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER, "#Java Settings \n")
    commerce_setup_helper.add_to_bashrc(INSTALL_OWNER,
                                        "##################### \n")
    commerce_setup_helper.add_to_bashrc(
        INSTALL_OWNER, "export JAVA_HOME=" + JAVA_HOME + "/latest \n")
    commerce_setup_helper.add_to_bashrc(
        INSTALL_OWNER, "export PATH=" + JAVA_HOME + "/latest/bin:$PATH \n\n")

    os.environ['JAVA_HOME'] = JAVA_HOME
    os.environ["PATH"] = JAVA_HOME + "/bin" + os.pathsep + os.environ["PATH"]
示例#15
0
def config_otd(configData, full_path):

    if json_key in configData:
        jsonArray = configData[json_key]
    else:
        logging.error(json_key +
                      " config data missing from json. will not install")
        return

    response_files_path = full_path + "/responseFiles/OTD11"

    for otdData in jsonArray:
        requiredFields = [
            'configName', 'installDir', 'adminUser', 'adminPassword',
            'installOwner', 'virtualServerName', 'virtualServerPort',
            'originServers', 'originPoolName', 'originServerType',
            'loadDistribution', 'healthCheckUrl', 'healthCheckMethod',
            'instanceHostname'
        ]
        commerce_setup_helper.check_required_fields(otdData, requiredFields)
        CONFIG_NAME = otdData['configName']
        INSTALL_DIR = otdData['installDir']
        INSTALL_OWNER = otdData['installOwner']
        ADMIN_USER = otdData['adminUser']
        ADMIN_PASSWORD = otdData['adminPassword']
        VSERVER_NAME = otdData['virtualServerName']
        VSERVER_PORT = otdData['virtualServerPort']
        OSERVERS = otdData['originServers']
        OPOOL_NAME = otdData['originPoolName']
        OSERVER_TYPE = otdData['originServerType']
        LOAD_ALG = otdData['loadDistribution']
        HEALTH_CHECK_URL = otdData['healthCheckUrl']
        HEALTH_CHECK_METHOD = otdData['healthCheckMethod']
        INSTANCE_HOME = otdData['instanceHome']
        INSTANCE_HOST = otdData['instanceHostname']
        OTD_START_BOOT = otdData['otd_start_onBoot']

        TADM_COMMAND = INSTALL_DIR + "/bin/tadm"
        otdPassword_replacements = {'TADM_ADMINPASSWORD': ADMIN_PASSWORD}

        # setup password file
        commerce_setup_helper.substitute_file_fields(
            response_files_path + '/otdPassword.pwd.master',
            response_files_path + '/otdPassword.pwd', otdPassword_replacements)

        # create new config
        configCommand = "\"" + TADM_COMMAND + " create-config --user="******" --password-file=" + response_files_path + "/otdPassword.pwd --listener-port=" + \
            VSERVER_PORT + " --server-name=" + VSERVER_NAME + " --origin-server=" + OSERVERS + " --origin-server-pool-name=" + OPOOL_NAME + " --origin-server-type=" + OSERVER_TYPE + " " + CONFIG_NAME + "\""
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, configCommand)

        # set load balancer algorithm
        loadDistCommand = "\"" + TADM_COMMAND + " set-origin-server-pool-prop --user="******" --password-file=" + response_files_path + "/otdPassword.pwd --config=" + \
            CONFIG_NAME + " --origin-server-pool=" + OPOOL_NAME + " load-distribution=" + LOAD_ALG + "\""

        commerce_setup_helper.exec_as_user(INSTALL_OWNER, loadDistCommand)

        # set health check URL
        healthCheckCommand = "\"" + TADM_COMMAND + " set-health-check-prop --user="******" --password-file=" + response_files_path + "/otdPassword.pwd --config=" + \
            CONFIG_NAME + " --origin-server-pool=" + OPOOL_NAME + " request-uri=" + HEALTH_CHECK_URL + " request-method=" + HEALTH_CHECK_METHOD + "\""

        commerce_setup_helper.exec_as_user(INSTALL_OWNER, healthCheckCommand)

        # create new instance
        instanceCommand = "\"" + TADM_COMMAND + " create-instance --user="******" --password-file=" + response_files_path + "/otdPassword.pwd --config=" + CONFIG_NAME + " " + INSTANCE_HOST + "\""
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, instanceCommand)

        # start the instance
        startInstanceCommand = "\"" + TADM_COMMAND + " start-instance --user="******" --password-file=" + response_files_path + "/otdPassword.pwd --config=" + CONFIG_NAME + " " + INSTANCE_HOST + "\""
        commerce_setup_helper.exec_as_user(INSTALL_OWNER, startInstanceCommand)

        if (platform.system() == 'SunOS'):
            startStopPath = "/startStopScripts/solaris/bootScripts/"
        else:
            startStopPath = "/startStopScripts/bootScripts/"

        OTD_INSTANCE_NAME = 'net-' + CONFIG_NAME
        SCRIPT_NAME = 'OTD-' + CONFIG_NAME
        # copy start/stop script
        otdScript_replacements = {
            'OTD_PROCESS_OWNER': INSTALL_OWNER,
            'OTD_INSTANCE_HOME': INSTANCE_HOME,
            'OTD_INSTANCE_NAME': OTD_INSTANCE_NAME
        }
        commerce_setup_helper.copy_start_script(
            OTD_START_BOOT, full_path + startStopPath + 'OTDAdmin.master',
            otdScript_replacements, SCRIPT_NAME)

        commerce_setup_helper.add_to_bashrc(
            INSTALL_OWNER, "# echo " + SCRIPT_NAME +
            " start/stop script: /etc/init.d/" + SCRIPT_NAME + "\n\n")