Loop state
Allows for looping over execution modules.
New in version 2017.7.0.
wait_for_service_to_be_healthy:
loop.until:
- name: boto_elb.get_instance_health
- condition: m_ret[0]['state'] == 'InService'
- period: 5
- timeout: 20
- m_args:
- {{ elb }}
- m_kwargs:
keyid: {{ access_key }}
key: {{ secret_key }}
instances: "{{ instance }}"
Warning
This state allows arbitrary python code to be executed through the condition parameter which is literally evaluated within the state. Please use caution.
salt.states.loop.
until
(name, m_args=None, m_kwargs=None, condition=None, period=0, timeout=604800)¶Loop over an execution module until a condition is met.
The name of the execution module
The execution module's positional arguments
The execution module's keyword arguments
The condition which must be met for the loop to break. This
should contain m_ret
which is the return from the execution
module.
The number of seconds to wait between executions
The timeout in seconds