Starting in Ansible v2.3 there is a new parameter for wait_for
module: active_connection_states
which default value is: [u'ESTABLISHED', u'SYN_SENT', u'SYN_RECV', u'FIN_WAIT1', u'FIN_WAIT2', u'TIME_WAIT']
Now imagine I want to wait for connections only with state in:
['ESTABLISHED', 'SYN_SENT', 'SYN_RECV']
to ensure load balanced connection have been drain after request it using any of the load balancers Ansible modules.
Example:
- wait_for:
host: 0.0.0.0
port: 8080
state: drained
active_connection_states: {{ connection_states_to_wait_for | default("[u'ESTABLISHED', u'SYN_SENT', u'SYN_RECV']") }}
Error: `
`
Also tried default("[u'ESTABLISHED', u'SYN_SENT', u'SYN_RECV']")
with same result.
Note I am trying to change module default behaviour but still using a variable to allow my plan or execution to wait for a different set of states, would be nice but not mandatory to use this ;)
How should I use this new param? I tried several approaches but none worked, and that's all I could found at the module documentation.
The parameter is supposed to be a list, not a string:
And/or:
You also need to properly quote the parameter value, as it starts with
{
character.