Creates an ansible-compliant dynamic inventory from AWS-EC2 instances.
- eu-central-1 region is used.
- Inventory is based on EC2 instances tags.
In the following examples, we assume you have an ansible/inventory directory
npm install -g ansible-ec2-inventory-js
#!/bin/bash
ansible-ec2-inventory
#!/bin/bash
npx ansible-ec2-inventory
Once you have created your inventory script, it will be executed along with your other inventory sources
ansible-playbook -i ansible/inventory ansible/your_playbook.yml