Hi,
we are trying to use the variable for the value of retries at loop. But always hit an error. We are using ansible version 1.4.3.
Here is the sample test playbook:
- hosts: test-servers
vars:
tries: 5
tasks: - name: test
debug: msg=“looping”
register: output
until: no
retries: “{{ tries | int }}”
delay: 1
Here is the error we got:
TASK: [test] ******************************************************************
fatal: [test01] => Traceback (most recent call last):
File “/usr/lib/python2.6/site-packages/ansible/runner/init.py”, line 394, in _executor
exec_rc = self._executor_internal(host, new_stdin)
File “/usr/lib/python2.6/site-packages/ansible/runner/init.py”, line 485, in _executor_internal
return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
File “/usr/lib/python2.6/site-packages/ansible/runner/init.py”, line 694, in _executor_internal_inner
for x in range(1, retries + 1):
TypeError: cannot concatenate ‘str’ and ‘int’ objects
FATAL: all hosts have already failed – aborting
Does anyone have some idea? Appreciate your help.
Thanks
Jack