Skip to content

CICD-248 · Dynamic inventory generation ​

Encyclopedia · Ansible and configuration management · All snippets

Previous · CICD-247 · Next · CICD-249

1. Where it fits ​

  • Placement CI run step.
  • Prerequisites controller with reviewed inventory, pinned Ansible collections and a non-production target.
  • Platforms local-linux, github-actions, gitea-actions.

2. Copy the snippet ​

bash
ansible-inventory -i inventory/staging.aws_ec2.yml --graph

3. How it works ​

The inventory command resolves configured host sources and groups before a playbook operates on them.

4. Verify the result ​

Enable the amazon.aws inventory plugin and tag filters. Verify the staging group contains only intended instances.

Validation syntax-validated (Bash parse). Status definitions.