Ansible Job Templates

A job template is a definition and set of parameters for running an Ansible job.

The Ansible job templates are discovered on the Managed services after making the Ansible connection. After the service deployment, the job templates are executed on the Ansible.

Procedure

  1. Check Editable flag if you want to edit these parameters while editing the service instance.

  2. Select or enter the following values for Basic Information:

    • Title - Enter title of the credential activity. It is a mandatory field. It is also the label name that appears in the credential activity.

    • Activity Id - The Id is automatically generated and is not editable. Click Copy to copy the value of the activity Id to your clipboard.

    • Template Name - It is the name of the template and is not editable.

    • Template Provider - It is the name of the provider and is not editable.

    • Version - Select the template version. A template is always at its default version.

      Note: If you select another version and again switch back to the original version, then service parameters gets overwritten by the values from the original template version.

    • Instance Name - Enter the instance name of the template activity.

    • Connection - There are different ways to enter values for the connection:

      • Steps to map an existing parameter or create a new parameter of type connection:

        1. Click Link Parameter in the Activity details pane to map a new parameter.

        2. In the Link Parameter dialog box, click Link to map an existing parameter.

        3. Map an existing parameter or create a new parameter and link it automatically:

          • Link parameters:

            1. Select a linking option. You can map parameter values using the Input Parameters and Templates menu options in the Link Parameter dialog box:

              • Input Parameters - The Input Parameters menu lists all of the parameters that are available in the Input Parameters section of the main Parameters tab of a service.
              • Templates - This option lists all parameters of all template activities that are available prior in sequence to this template activity.

              The values displayed in the Activity details pane change based on what you select and which activities you use in your service workflow.

              Note: For example, if there are two templates A and B placed in sequence in the Provision Action of the Composition tab, then parameters of both the templates are available in the Activity Parameters section of the Parameters tab. If you want to link a parameter of template B, then a list of all parameters of the template A and shared parameters are available for association. If your service involves Business Process Manager activities and helm charts, then they are also available for linking. For the very first activity, template A, you can only link input parameters and shared parameters.

            2. Expand the parameter menu and hover over the parameters to see a plus icon.

            3. Click the plus icon to select it. A green tick mark indicates your selection and also the Value is refreshed. You can also use the Search Parameter to filter and find a parameter.

            4. Click Save.

            5. You can also click Remove Link in the Link Parameter dialog box to remove a mapping.

          • Create a new parameter and link it at the same time:

            1. In the Link Parameter dialog box, click Create.
            2. Enter a value for the Parameter Key.
            3. Enter or select values for the new parameter.
            4. Enter values for Read and Write permission. When you create a service instance, you can make changes to the values that were defined during creation. Enter or select the following values for Read and Write permission:
              • Parameter Type - You cannot change the parameter type. It is connection by default.
              • Display Name - The label or display name of the parameter.
              • Description - The description appears as a tooltip when the customer orders this service.
              • Cloud Provider - The cloud provider is pre-selected. You cannot change the value.
              • Default Value - Optionally, enter the value for connection. If you do not provide the value during design time, you must add it during deployment.
            5. Click Save to create and save the new parameter.
      • You can create a parameter of type string in the Parameter tab. In the Source Code tab, change its type to connection and add provider value as shown in the following example:

        "input_parameters": [
        {
        "name": "Conn",
        "label": "Conn",
        "Customtype": "string",
        "type": "connection",
        "provider": "VMware vSphere",
        "immutable": false,
        "hidden": false,
        "required": false,
        "secured": false
         }
        ]
        

Update the details in Parameters tab. For more information, see Parameters tab of Ansible Job Template activity.

If a parameter has Read-Write user permission, then you can edit the values to override existing permission and parameter values.