Augment mode examples

Examples describe how to use augment mode and augment mode options.

Example 1: Saving multiple variables in an augment file

Objective: Save multiple variables in an augment file. On execution, variables in the augment file that already exist in the WebSphere® configuration are not added.

  1. Create the variables_augment.xml file.
    <?xml version="1.0"?>
    <Variables>
    <RAFW_variables>
       <VariableSubstitutionEntry
          symbolicName=" MKT_SHARED_LIB_HOME"
          value="cell"
       >
       </VariableSubstitutionEntry>
    </RAFW_variables>
    </Variables>
  2. Save the variables_augment.xml file to augment directory at the Cell01 scope.

    RAFW_HOME/user/environments/dev/cells/Cell01/augment/variables_augment.xml

  3. Run the action was_common_configure_variables in augment mode:

    rafw.sh -e env -c cell –augment was_common_configure_variables

    Step result:  The rafw command creates the custom variable MKT_SHARED_LIB_HOME, assigns it a value of /opt/ibm/sharedLibs/marketing, and adds it to the WebSphere cell configuration.

  4. Edit the variables_augment.xml file. Add a new custom variable called APP_NAME and assign it a value of "myApp".
    <Variables>
    <RAFW_variables>
       <VariableSubstitutionEntry
          symbolicName="MKT_SHARED_LIB_HOME"
          value="/opt/ibm/sharedLibs/marketing"
       >
       </VariableSubstitutionEntry>
       <VariableSubstitutionEntry
          symbolicName="APP_NAME"
          value="myApp"
       >
       </VariableSubstitutionEntry></RAFW_variables>
    </Variables>
  5. Run the was_common_configure_variables action in augment mode:

    rafw.sh -e env -c cell –augment was_common_configure_variables

    Step result: The rafw command creates the new variable APP_NAME, assigns it a value of "myApp", and adds it to the WebSphere cell configuration.

    Because MKT_SHARED_LIB_HOME variable already exists, it is not added to the configuration.

Example 2: Saving the augment file to an alternate directory

Objective: Save the augment file to a directory name other than augment, if you need to create multiple augment files at the same scope.

  1. Create the variables_augment.xml file.
    <?xml version="1.0"?>
    <Variables>
    <RAFW_variables>
       <VariableSubstitutionEntry
          symbolicName="IO_DIR"
          value="/opt/ibm/drivers"
       >
       </VariableSubstitutionEntry>
    </RAFW_variables>
    </Variables>
  2. Save the variables_augment.xml file to the application directory at the Cell01 scope:

    RAFW_HOME/user/environments/dev/cells/Cell01/application/variables_augment.xml

  3. Run the was_common_configure_variables action in augment mode and specify the option: -opt "augmentDir=application".

    rafw.sh -e env -c cell –augment was_common_configure_variables -opt "augmentDir=application"

    Step result: Using the application/variables_augment.xml file, the rafw command adds the custom variable IO_DIR, assigns it a value of /opt/ibm/drivers, and adds it to the WebSphere cell configuration.

Example 3: Use a single command to augment and synchronize configurations

Objective: Synchronize the cell definition in the environment tree to match the newly augmented configuration in WebSphere. Use this option as an alternative to running import as a separate command to synchronize the cell definition.

  1. Create the variables_augment.xml file.
    <?xml version="1.0"?>
    <Variables>
    <RAFW_variables>
       <VariableSubstitutionEntry
          symbolicName="APP_TEMP_DIR"
          value="/opt/ibm/tmp"
       >
       </VariableSubstitutionEntry>
    </RAFW_variables>
    </Variables>
  2. Save the variables_augment.xml file to the augment directory at the Cell01 scope:

    RAFW_HOME/user/environments/dev/cells/Cell01/augment/variables_augment.xml

  3. Run the was_common_configure_variables action in augment mode and specify the option: -opt "importAfterAugment".

    rafw.sh -e dev -c cell –augment was_common_configure_variables -opt "importAfterAugment=true"

    Step result: The rafw command:

    1. Creates the custom variable APP_TEMP_DIR, assigns it a value of /opt/ibm/tmp, and adds it to the WebSphere cell configuration.
    2. Adds the APP_TEMP_DIR with a value of /opt/ibm/tmp to the variables.xml file in the cell definition.

Example 4: Using a WebSphere data file as a model for creating the augment file

Objective: Create the augment file by using a WebSphere data file that already contains the correct configuration data as a starting point.

In this example, the jdbc_augment.xml file is created using the jdbc.xml file as a model.

  1. Use the WebSphere administrative console to create a new data source configuration for Cell01 in the Integration environment.

    Step result: The new data source configuration is added to the jdbc.xml file.

  2. Use the was_common_configure_jdbc_datasources action to import (delete and replace) the data source configuration in the environment tree.
    rafw.sh -e integration -c Cell01 -import was_common_configure_datasources

    Step result:

    RAFW_HOME/user/environments/integration/cells/Cell01/jdbc.xml

  3. Create the augment file by copying the jdbc.xml from the Integration environment to the Production environment.

    Save the jdbc.xml file as jdbc_augment.xml.

    RAFW_HOME/user/environments/production/cells/Cell01/augment/jdbc_augment.xml

  4. Edit the jdbc_augment.xml file, deleting all the data source configurations except the new one to be added to Cell01 in the Production environment.
    <?xml version="1.0"?>
    <jdbc>
    <RAFW_JDBCDataSources>
       <DataSource
       authDataAlias="dmgr/JAAS - J2C - alias"
          authMechanismPreference="BASIC_PASSWORD"
          datasourceHelperClassname="com.ibm.websphere.rsadapter.Oracle10gDataStoreHelper"
          description="New JDBC Datasource"
          diagnoseConnectionUsage="false"
          jndiName="data/jndiName"
          logMissingTransactionContext="true"
          manageCachedHandles="false"
          name="DataSource - Oracle JDBC Driver XA DataSource"
          properties=""
          providerType="Oracle JDBC Driver (XA)"
          statementCacheSize="10"
          xaRecoveryAuthAlias="dmgr/JAAS - J2C - alias"
       >
    	Additional XML Nodes Requires for DataSource definition have been removed for brevity
       </DataSource>
    </RAFW_JDBCDataSources> 
    </jdbc>
  5. From Cell01 in the production environment, run the action was_common_configure_jdbc_datasources in augment mode.

    rafw.sh -e production -c Cell01 –augment was_common_configure_datasources

    Step result: The rafw command adds the new data source in jdbc_augment.xml to the Production environment and assigns it a value of data/jndiName.


Feedback