Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Use properties files to manage system configuration > Manage specific configuration objects using properties files
Work with variable map properties files
We can use properties files to create, modify, or delete property-value pairs in variable maps.
Determine the changes to make to your variable map.
Start wsadmin.sh.
To start wsadmin using the Jython language, run...
WP_PROFILE/bin/wsadmin -lang jython
Use a properties file, you can create, modify, or delete one or more variable substitution entries in a variable map.
Run administrative commands using wsadmin to create or change a properties file for a variable map, validate the variable substitution entries, and apply them to the configuration.
Actions for variable map properties. You can create, modify, and delete properties and values in variable maps.
Action Procedure create Not applicable modify Edit property values in the variable map properties file and then run applyConfigProperties to modify the values of existing variables. delete Not applicable create Property Edit the variable map properties file and then run applyConfigProperties to create a variable substitution entry. delete Property Run deleteConfigProperties to delete an existing variable substitution entry. The properties file must contain only the properties to be deleted. Optionally, you can use interactive mode with the commands:
AdminTask.command_name('-interactive')
Procedure
- Modify an existing properties file.
- Obtain a properties file for the variable map that you want to change.
We can extract a properties file for a VariableMap object using the extractConfigProperties command.
- Open the properties file in an editor and change the properties as needed.
Modify the Environment Variables section to match the system and set any property value that needs to be changed.
To specify a variable substitution entry, edit the AttributeInfo value and properties values. An example VariableMap properties file follows:
# # Header # ResourceType=VariableMap ImplementingResourceType=VariableMap ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:VariableMap= AttributeInfo=entries(symbolicName,value) # #Properties # SERVER_LOG_ROOT=${LOG_ROOT}/!{serverName} WAS_SERVER_NAME=!{serverName} # EnvironmentVariablesSection # #Environment Variables cellName=myCell04 nodeName=myNode serverName=myServer- Run applyConfigProperties to create or change a VariableMap configuration.
Run applyConfigProperties applies the properties file to the configuration. In this Jython example, the optional -reportFileName parameter produces a report named report.txt:
AdminTask.applyConfigProperties(['-propertiesFileName myObjectType.props -reportFileName report.txt'])
- If you no longer need a variable substitution entry, you can delete the entry.
To delete a variable substitution entry, specify only the entry to be deleted in the properties file and then run deleteConfigProperties; for example:
AdminTask.deleteConfigProperties('[-propertiesFileName myObjectType.props -reportFileName report.txt]')
Results
We can use the properties file to configure and manage the variable map properties.
What to do next
Save the changes to the configuration.
Extract properties files using wsadmin.sh
Create server, cluster, application, or authorization group objects using properties files and wsadmin scripting
Delete server, cluster, application, or authorization group objects using properties files
Related
PropertiesBasedConfiguration command group using wsadmin.sh