Interview Prep/Ansible/Vault, Performance and Execution Behaviour

An `uri` call to the CMDB returns `HTTP Error 429: Too Many Requests` for most hosts

IntermediateTroubleshootingVault, Performance and Execution Behaviour
Answer

Likely causes → With forks: 50, fifty hosts hit the API at the same moment, and the API rate-limits.

Fix →

- ansible.builtin.uri:
    url: https://cmdb.internal/api/hosts/{{ inventory_hostname }}
  delegate_to: localhost
  throttle: 5
  register: cmdb
  until: cmdb.status != 429
  retries: 5
  delay: 10

throttle limits only this task, without slowing the rest of the play.

Prevent → Use throttle for shared external dependencies (APIs, license servers, package mirrors), or make one bulk API call with run_once.

All Ansible questions Roadmap: Ansible

More on Vault, Performance and Execution Behaviour