Many applications reference configuration files when they execute. The application definition enables you to create and update files as part of the definition.
- Click Designer, and select Package in the upper right corner.
- In the upper right corner of Package, click the Create a new package icon to open the Package Details pane, or select an application package and click the Edit Application icon to open the Package Details pane.
- On the bottom right corner of the Package Details pane, expand the Configure Installation Actions tab.
- Click + (Add).
The Define Action dialog opens
- Select Create File or Update File from the Action drop-down list.
- Input the file name, and specify the File Format for the Create File option.
- Select the supported Operating System for specified action.
Note: Specifying the supported operating systems for actions and applications enables you to define separate OS-specific actions. An action only executes when an application deploys to the specified operating systems for that action. For example, define an application that supports Windows and Linux, and specify separate .bat and .sh actions for Windows and Linux respectively.
- (Optional) Specify user credentials to use when executing the action.
Note: This option enables user-restricted actions during stack provisioning. The primary use case is to enable clustered application deployment using domain user credentials.
- Click Add Options to add parameters to a file for the create file action, and click the New Option icon:
- Specify the name of the option (for example, action parameter) in the Option column of the options table.
- Specify Description, Label, data type, and a Default Value for the action parameter.
Note: (optional) Create the Value list by click + (Add) after adding a new value in the default column.
- (Optional) Select User Editable to indicate that the end user can input a value for the action parameter during the execution of the command. Specify a Label as the prompt that the end user receives when an input is required.
- (Optional) Select Mandatory to specify that a user input is required.
- Click OK to exit the Define Action dialog.
The action adds the parameter and value to the properties file. Repeat this step for each option in the file.
- Example: To Add an Editable Password to a Key-Value Properties File
-
- Specify the Action Parameter password
- Specify the Default Value changeit
- Select User Editable, and specify Label Input Password.
CA Server Automation adds password=changeit to the properties file. When users provision the service, CA Server Automation prompts them to input a password.
- To edit parameters in a file for the update file action, click the Add icon:
- Specify the text to replace in Option (for example, the Action Parameter).
- Specify the new text in the Default Value input.
Note: Use the Value List to maintain a set of values for the parameter.
- (Optional) Select User Editable to indicate that the end user can input a value for the action parameter during the execution of the command. Specify a Label as the prompt the end user receives when an input is required.
- (Optional) Select Mandatory to specify that a user input is required..
The action replaces the specified text in the file with the new values. Repeat this step for each text string to replace.
- Example: To Specify a Wiki Name in a Generic Wiki Properties File
-
- Specify the Action Parameter ###WIKINAME###
- Specify the name of your Wiki site as the Default Value
CA Server Automation replaces instances of ###WIKINAME### in the properties file with the name of your Wiki site.
- (Optional) Repeat steps 3 through 10 to add additional actions to apply during application execution. Use the up and down arrows to specify the order in which to execute actions.
- Click OK to close the Define Action dialog.