With Application Services, you can create a custom task to perform customized tasks in the application deployment such as run security patches.
About this task
The Application Services catalog contains predefined tasks to configure APT or YUM repositories, a script to register a machine to the Red Hat network, or a script to enable a virtual machine to connect to the designated Windows Active Directory domain. You can add these customized tasks to the execution plan in a deployment profile. In some cases, rather than creating a custom task, you might prefer to edit a predefined task.
Save your changes frequently. The Application Services user interface session expires after 30 minutes of inactivity. If the session expires, any changes that were not saved are lost.
Log in to Application Services as an application cloud administrator and an application publisher and deployer.
If a script in a task requires access to URLs from outside the corporate firewall, configure the applicable services and application components to use a proxy. See Configure Application Services to Use a Proxy for External URLs.
Familiarize yourself with the basic concepts of defining and configuring component properties and actions. See Developing Application Services Components.
- On the Application Services title bar, click the drop-down menu and select .
- Click New.
- Set the name of the custom task, add a description, and click Save.
As a best practice, use a name that corresponds to the task the script performs.
- Click Create Task Version to create a custom task version.
You can create multiple versions for a custom task.
A page appears for creating a custom task version.
- Complete the custom task version information.
Task version name stays the same.
Add detailed information about the custom task. For example, describe what the script does when added to a node in the execution plan.
You can specify major, minor, or micro releases, with or without qualifiers. For example, you might use unique version numbers such as 1.0 or 1.5.
If the scripts used in this task can run only on particular operating systems, select those operating systems here. In the execution plan, Application Services prevents the custom task from appearing in the Catalog Task Name list unless it contains one of these operating systems. You must add at least one operating system in the text box.
To create an operating system name that is not in the list, click Cancel, and select .
- In the Properties section, define the variables used for a custom task.
Click the first row of the Property Name column to define a variable. For example, you might create a custom task to configure a repository or create a custom email task to send a notification email when the deployment task for a service or application component successfully finishes.
Include details about the custom task.
To change the type, select a type from the drop-down menu. The available property types are String, Content, and Array. You cannot add types to the menu.
Type the value to substitute for this property when the custom task runs. For example, for a property called remove_all, you might type either true or false in this text box.
Select the check box for passwords you define or other properties whose values you want to obscure. For example, the JBOSS_JMX_PWD property in the JBoss service is secured.
If a property is changed from Secured to Unsecured, Application Services resets the property value, for security purposes. You must set a new value for the property.
Removes the selected row from the Properties section.
- In the Script Editor section, add a script for the custom task.
A catalog administrator can parameterize the installation and configuration of services. The properties that are defined for a service can be used inside the script.
- Expand the Edit script dialog box, set the script type from the drop-down menu to write a script or copy a script.
- Select the Reboot check box to restart the virtual machine after the script runs successfully, during an application deployment.
- Click the down arrow in the Select a property to insert list to add custom task properties.
- Click OK when you are finished.
- When you finish creating the custom task, click Save.
The custom task you created is added to the Tasks page.
What to do next
You can add a custom task in the execution plan and deploy it to a deployment environment. See Review the Execution Plan and Add Custom Tasks. Modify the custom task to support your current needs. See Maintain Custom Task Versions.