run-operational-process-for-multiple-components#

The run-operational-process-for-multiple-components step executes a component operational process for multiple components and waits for them to complete. This step is only valid in an application process.

Format#

run-operational-process-for-multiple-components "foo" is
    -- name of the component process to run for each component; required
    process "my-component-operation"

    -- select components to target by component tag; optional
    -- before 7.1.1.0, the tag must be specified by internal database ID
    select-components-by-tag "my-tag"

    -- select resources to run on by resource tag; optional
    -- currently, the tag must be specified by internal database ID
    select-resources-by-tag "171603dd-389d-3183-c496-5ca60f4378f2"

    -- select resources to run on based on inventory changes in other components; optional
    select-resources-by-changed-component-tag
        -- select components to monitor for inventory changes by tag; optional
        -- currently, the tag must be specified by internal database ID
        select-components-by-tag "1714f9ea-1aa0-405d-f8df-ae131fcee7be"

        -- specify which resources of this process's component are selected; required
        --   all - select all resources where this process's component is mapped
        --   with-changed-component - select only resources where both this process's component
        --                            and a monitored component are mapped and the monitored
        --                            component has changed
        select-resources all
    end

    -- don't start further children after a failure; optional
    -- default is false
    fail-fast false

    -- suppress warnings generated by children; optional
    -- default is false
    ignore-child-warnings false

    -- only run on one online resource; optional
    -- default is false
    run-on-first-online-resource-only true

    -- maximum number of concurrent processes per component; optional
    -- default is unlimited
    max-concurrent-processes unlimited

    -- maximum number of components to deploy concurrently; optional
    -- default is 100
    max-concurrent-components 100

    -- javascript precondition script that must evaluate to true for the step to execute; optional
    precondition-script
        """
        true
        """

on success
    finish
end
Field Description
Name A name for the step. Other process steps can refer to this step by this name.
Component Tag A user-defined component tag that is used to select components. Only components with the specified tag are modified by this step.
Component Process A process for the components that contain the selected tag. Only components that contain the process will run. Only one process can be selected per step.
Limit to Resource Tag The user-defined resource tag that determines which resource runs the process. Only a resource with this tag, or a resource that has a parent with this tag, runs the process. See Adding tags to objects.
Maximum number of concurrent components The maximum number of components on which to run processes at one time. For example, if you specify 5, this step runs processes on five components at a time. To run an unlimited number of concurrent processes, specify -1. To limit the number of processes to run at once, as in rolling deployments, specify an integer. The server attempts to resolve the value to an integer. If the value does not resolve to an integer, then the -1 value is used by default. You can use a property in this field, as long as the property resolves to an integer.
Maximum number of concurrent processes The maximum number of concurrent processes to run, per component. This setting limits the number of processes that run simultaneously. For example, if you set the maximum number of concurrent processes to 2, the process runs on only two instances of a component at a time, even if many instances of the component are installed. To run an unlimited number of concurrent processes, specify -1 . To limit the number of processes to run at once, as in rolling deployments, specify an integer. The server attempts to resolve the value to an integer. If the value does not resolve to an integer, then the -1 value is used by default. You can use a property in this field, as long as the property resolves to an integer.
Fail Fast If this check box is selected, the step does not start more processes after one process fails.
Run on First Online Resource Only Instead of being run by all agents that are mapped to the environment, the step runs only on the first online agent that the server identifies. The mechanism that is used to identify the "first" agent is database-dependent, and thus indeterminate. If no agents are online, the server skips the step and marks its status as "Not Mapped." This setting may cause the environment to become noncompliant or to provide unexpected results, because only one agent runs the process, even if many agents are mapped to the environment.
Precondition A JavaScript 1.7 script that defines a condition that must exist before the step can run. The condition must resolve to true or false. In the script, do not use the ${p:component.myProperty} notation. For example, to check the value of a component property in a component process, use properties.get("myProperty") == "myValue". See Property contexts for information about property access.
Run If Component with Tag Changes To run this step only if another step in the application process changes the inventory of a component, select this option. If you select a component tag, for this step to run, a component that contains that tag must have an inventory change. If you do not select a component tag, any inventory change that is caused by the application process causes this step to run. Note: Do not select the same component tag that you selected in the Component Tag list. Select an option in the Resource Selection Mode list to control the agent resources that this step runs on. To run the step on only resources where the inventory of other components changes, select Only resources where component with selected tag is changed. For example, you might have a component that contains some operational processes, such as "Restart HTTP Server." If you add the operational process to the application process, you can select this option to run only on machines where you are deploying changes to websites that are hosted. To run the operational process on all possible resources, select All resources mapped to this process's component. For example, if you deploy changes to a website, you might want to restart a load balancer that is on a different machine than the website. You can select this option to run the operational process wherever the "Load Balancer" component that contains the "Restart Load Balancer" operational process is mapped.

Example#

start is

    start A

    start B

    start C

    start D

    start E

end



run-operational-process-for-multiple-components step A is

    process "proc-1"

    select-components-by-tag "comp-tag-1"

    select-resources-by-tag "resource-tag-1"

    select-resources-by-changed-component-tag

        select-components-by-tag "comp-tag-2"

        select-resources all

    end

    fail-fast true

    ignore-child-warnings true

    run-on-first-online-resource-only true

    max-concurrent-processes 1

    max-concurrent-components 2

    precondition-script "script-1"

on success

    finish

end



run-operational-process-for-multiple-components step B is

    process "proc-2"

    select-resources-by-changed-component-tag

        select-resources with-changed-component

    end

on success

    finish

end



run-operational-process-for-multiple-components step C is

    process "proc-3"

    select-resources-by-changed-component-tag

        select-components-by-tag "comp-tag-3"

        select-resources with-changed-component

    end

on success

    finish

end



run-operational-process-for-multiple-components step D is

    process "proc-4"

    select-components-by-tag "comp-tag-4"

    select-resources-by-tag "resource-tag-2"

    fail-fast true

    ignore-child-warnings true

    run-on-first-online-resource-only true

    max-concurrent-processes 3

    max-concurrent-components 4

    precondition-script "script-2"

on success

    finish

end



run-operational-process-for-multiple-components step E is

    process "proc-5"

on success

    finish

end

Parent topic: Application process steps