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.

Prerequisites

Procedure

  1. On the Application Services title bar, click the drop-down menu and select Library > Tasks.
  2. Click New.
  3. 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.

  4. 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.

  5. Complete the custom task version information.

    Option

    Description

    Name

    Task version name stays the same.

    Description

    Add detailed information about the custom task. For example, describe what the script does when added to a node in the execution plan.

    Version

    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.

    Supported OSes

    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 Library > Operating Systems.

  6. In the Properties section, define the variables used for a custom task.

    Option

    Description

    Property Name

    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.

    Description

    Include details about the custom task.

    Type

    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.

    Value

    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.

    Secured

    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.

    Delete button

    Removes the selected row from the Properties section.

  7. 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.

    1. Expand the Edit script dialog box, set the script type from the drop-down menu to write a script or copy a script.
    2. Select the Reboot check box to restart the virtual machine after the script runs successfully, during an application deployment.
    3. Click the down arrow in the Select a property to insert list to add custom task properties.
    4. Click OK when you are finished.
  8. When you finish creating the custom task, click Save.

Results

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.