for-each-agent

The for-each-agent application process step lets you run a process for each agent in an environment.

Format

for-each-agent step "loop1" is
    -- define target resource tags; optional, repeatable
    -- before 7.1.1.0, the tag must be specified by internal database ID
    tag "res-tag-1"
    tag "res-tag-2"

    -- maximum number of agents to target concurrently; optional
    -- default is unlimited
    max-concurrent-agents unlimited

    -- must contain an embedded 'start' block that works like the top-level version
    start is
        start "install-c1"
    end

    -- contains one or more embedded steps of any type except for other for-each steps
    install-component step "install-c1" is
        component "c1"
        process "deploy"
        without-status "Active"
        fail-fast true
        ignore-child-warnings true
        max-concurent-processes 43

    -- on success/failure/complete reference steps inside the for-each
    -- 'finish' refers to the implied finish step inside the for-each
    on success
        finish
    end

-- on success/failure/complete outside an embedded step reference steps in the top-level process
on success
    start "next-step"
end

Properties

Table 1. For Each Agent properties
Field Description
Name A name for the iteration container.
Limit to Resource Tags A list of resource tags that limit the container. The subprocess runs only on the agent resources that have one or more of the specified resource tags.
Maximum number of concurrent processes The maximum number of agents that run the subprocess at a time. To run the subprocess on every agent at once, specify -1. To limit the number of agents to deploy to at once, as in blue/green deployments or 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.

Example

start is
    start A
    start B
end

for-each-agent step A is
    tag "res-tag-a1"
    tag "res-tag-a2"
    tag "res-tag-a3"

    max-concurrent-agents 42

    start is
        start A1
    end

    set-final-process-status step A1 is
        status success
    on success
        finish
    end
on complete
    finish
end

for-each-agent step B is
    start is
        start B1
    end

    set-final-process-status step B1 is
        status success
    on success
        finish
    end
on complete
    finish
end