It worked!
Since i the first is 0, the last should be {{nb_of_agents -1 |int}}
- name: output
debug:
var: qb_svc.results[item|int].exists
with_sequence: start=0 end='{{nb_of_agents - 1 |int}}'
Thanks
On Tuesday, May 22, 2018 at 9:39:50 AM UTC+3, Jordan Borean
Looks like item is being used as a unicode string (u'1') and not an int,
can you try qb_svc.results[item|int].exists and see if that works?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving
Thank you Jordan
Actually, I also tried without the "." as you suggested and it didn't work
Code:
- name: output
debug:
var: qb_svc
- name: output
debug:
var: qb_svc.results[item].exists
with_sequence: count='{{nb_of_agents}}'
Here is my output
You can't normally run in parallel with a loop, they are run sequentially.
You can hack around it by running with async and poll 0 and then poll that
status but it isn't a perfect "run all items in list in parallel" that you
are looking for.
Your debug output
- name: output
debug:
var:
Hi David
Here it is:
- name: check service '{{ item }}' is not already running
win_service:
name: Build Agent Prod '{{ item }}'
register: svc
with_sequence: start=1 end='{{nb_of_agents}}'
- name: output
debug:
var: svc
- name: output
Please paste the code WITHOUT any formatting. Font should be any
single-space so that spacing is correct.
On Mon, May 21, 2018, 15:55 Jeremie Levy wrote:
> Hi
> I'm trying to do the following (in windows but it's not important):
>
>
>1. Need to deploy N number of build