Replace custom serial loop with throttle

We can use throttle now that we require Ansible 2.9.

Change-Id: I567e83cac4d5e80bd097b30ddefa0cc188118ad2
This commit is contained in:
Pierre Riteau
2021-04-29 11:38:29 +02:00
parent 48fdca1dfc
commit 9033d28435

View File

@@ -29,7 +29,7 @@
module: known_hosts module: known_hosts
host: "{{ item[0].item }}" host: "{{ item[0].item }}"
key: "{{ item[1] }}" key: "{{ item[1] }}"
# TODO(priteau): Replace the following with "throttle: 1" once we require with_subelements:
# Ansible >= 2.9 - "{{ keyscan_result.results }}"
loop: "{{ query('subelements', ansible_play_batch | map('extract', hostvars, ['keyscan_result', 'results']) | map('first') | list, 'stdout_lines') }}" - stdout_lines
run_once: True throttle: 1