Interview Prep/Ansible/AWX, Cloud and Large-Scale Operations

You must provision AWS infrastructure with Ansible. How would you structure it?

AdvancedScenarioAWX, Cloud and Large-Scale Operations
Answer

Situation read → Cloud provisioning.

What I'd do →

  1. Use amazon.aws modules (ec2_instance, ec2_security_group, elb_application_lb).
  2. Run on localhost with connection: local.
  3. Auth with an IAM role or environment credentials, not keys in the repo.
  4. Make every call idempotent by naming and tagging.
- hosts: localhost
  connection: local
  gather_facts: false
  tasks:
    - amazon.aws.ec2_instance:
        name: app-01
        image_id: "{{ ami }}"
        instance_type: t3.small
        vpc_subnet_id: "{{ subnet }}"
        tags: { Env: prod, Role: app }
        state: running

Why → Tags identify existing resources, so reruns do not create duplicates.

Interview tip → Be ready to say Terraform provisions, Ansible configures, and why.

All Ansible questions Roadmap: Ansible

More on AWX, Cloud and Large-Scale Operations