Interview Prep/Ansible/Performance and Scale

How do you transfer large files or artifacts efficiently?

IntermediateProductionPerformance and Scale
Answer

Avoid pushing large files from the controller to every host: the controller's bandwidth becomes the bottleneck. Let the targets pull from where the data lives.

- ansible.builtin.get_url:
    url: "{{ artifact_url }}"          # presigned S3 URL or internal repo
    dest: /opt/app/app.tar.gz
    checksum: "sha256:{{ artifact_sha256 }}"
- ansible.builtin.unarchive:
    src: /opt/app/app.tar.gz
    dest: /opt/app/releases/{{ app_version }}
    remote_src: true

For directory trees between hosts use synchronize (rsync). Always verify a checksum.

All Ansible questions Roadmap: Ansible

More on Performance and Scale