Dynamic Inventories with AWS EC2 Plugin
Intermediate · 40 minutes · 100 points
Learn how to configure and use Ansible's AWS EC2 dynamic inventory plugin to automatically discover and group EC2 instances. You will set up the plugin configuration, define inventory filters, work with host groups based on tags and regions, and write playbooks that target dynamically discovered hosts. This lab uses a simulated AWS environment with mocked boto3 responses so no real AWS account is required.
What you’ll learn
- Install and verify boto3 and botocore dependencies required by the AWS EC2 inventory plugin
- Create a valid aws_ec2.yml dynamic inventory plugin configuration file with filters and keyed_groups
- Simulate AWS EC2 responses using placebo to test dynamic inventory without a real AWS account
- Write and run an Ansible playbook that targets host groups populated by the dynamic inventory plugin
How this lab works
- Start the lab: One click starts a container on your computer with a real terminal: nothing to install by hand, nothing to clean up.
- Work through 4 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work runs each task’s checks in your container and says what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: A container on your computer, with a real terminal
- Image: cytopia/ansible:latest
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
Topics: ansible, aws, ec2, dynamic-inventory, boto3, cloud, inventory-plugin, infrastructure
Create a free account to start this lab.