diff --git a/ansible/roles/ssh-known-host/tasks/main.yml b/ansible/roles/ssh-known-host/tasks/main.yml index 6a16af52c..d752ee42d 100644 --- a/ansible/roles/ssh-known-host/tasks/main.yml +++ b/ansible/roles/ssh-known-host/tasks/main.yml @@ -29,7 +29,7 @@ module: known_hosts host: "{{ item[0].item }}" key: "{{ item[1] }}" - # TODO(priteau): Replace the following with "throttle: 1" once we require - # Ansible >= 2.9 - loop: "{{ query('subelements', ansible_play_batch | map('extract', hostvars, ['keyscan_result', 'results']) | map('first') | list, 'stdout_lines') }}" - run_once: True + with_subelements: + - "{{ keyscan_result.results }}" + - stdout_lines + throttle: 1