Add conditional actions to your blueprint with the Conditional step

The Conditional Step enables you to insert conditions into your blueprint, and specify actions to take when those conditions are met. For example, you can use blueprint inputs that you supply or the output of another step to trigger actions such as sending a notification or approval, running a script, or executing another blueprint.

The conditions and actions you specify are grouped into paths (for example, Path A, Path B, and so on). All conditions in a path must be satisfied for the specified action to occur. You can configure multiple paths to ensure alternative actions are taken if the conditions in a particular path are not met. If the conditions in any path are not met, no actions in the step occur.

Important: When deploying blueprints that contain Conditional Steps, you must allow Smart Tools to provision new VMs. Using existing machines with these blueprints is not supported and will result in failed deployments. 

Example: Send a notification when a server is created

The following example illustrates how to use a conditional step in a blueprint. In this example, a notification is sent if a server is created successfully. If the server is not created successfully, Smart Tools waits for a defined interval.

Step 1: Configure the condition paths

  1. Create a new blueprint or edit an existing blueprint. Ensure the Deploy page of the Blueprint Designer is displayed.
  2. In the left pane, expand Cloud Steps and drag and drop the Server step into your blueprint.
  3. Expand Utility Steps and drag and drop the Conditional Step into your blueprint.
  4. Click Configure Now to add conditions and actions. The Configure Conditional Step dialog displays Path A. 
  5. Configure Path A:
    1. Under Variable, click the Reference Tree button clm-reference-tree-icon.png. The Reference Tree dialog box appears.
    2. Expand the blueprint node and then expand the Server step node.
    3. Select status and then click OK. The Server : status variable appears in Path A. By default, the value is Complete.
  6. Add and configure Path B:
    1. Click the plus (+) sign next to Execute Path A to add another path. Path B appears beneath Path A.
    2. Under Variable, click the Reference Tree button clm-reference-tree-icon.png. The Reference Tree dialog box appears.
    3. Expand the blueprint node and then expand the Server step node.
    4. Select status and then click OK. The Server : status variable appears in Path B.
    5. Under Operator, select not equals for the variable and then click OK to return to the Blueprint Designer.

Step 2: Assign an action to Path A

  1. In the Blueprint Designer, locate the Conditional Step you just configured and click Execute Path A. The Blueprint Designer page scrolls down to the Conditional Steps & Blueprints section for Path A.
  2. In the left pane, under Utility Steps, drag and drop the Alert / Notify / Approve step to the Conditional Steps & Blueprints section of the Conditional Step.
  3. Click Configure Now. The Configure Step dialog box appears.
  4. In Do you want to setup any triggers for this alert, select Yes.
  5. Under Variable, click the Reference Tree button clm-reference-tree-icon.png. The Reference Tree dialog box appears.
  6. Expand the blueprint node and then expand the Conditional Step node.
  7. Select status and then click OK. The Conditional Step : status variable appears as an alert trigger. By default, the value is Complete. Click Next.
  8. Configure the alert notification. For example, add recipient email addresses, add a Subject, and compose the message you want to send. Click Next.
  9. On the Alert Approvals dialog box, click Finish to return to the Blueprint Designer. The Alert / Notify / Approve step displays the configured alert trigger.

Step 3: Assign an action to Path B

  1. Scroll up to the Else section of the Conditional Step and click Execute Path B. The Blueprint Designer scrolls down to the Conditional Steps & Blueprints section for Path B.
  2. In the left pane, under Utility Steps, drag and drop the Wait Step to the Conditional Steps & Blueprints section. 
  3. Leave the Time to Wait value at the default.
  4. Save the blueprint.

0 Comments