I am trying to use dynamic inventory using AWS Ec2 along with some static variables. I created a directory which contains ec2.py, ec2.ini (aws config files as stated in the docs) and vars.ini (containing my static variables). https://docs.ansible.com/ansible/latest/user_guide/intro_dynamic_inventory.html#using-inventory-directories-and-multiple-inventory-sources seems to sugggest that passing the path to this directory in the -i argument to ansible-playbook should work. However, I am seeing an undefined variable error when i run the command. What might I be missing?
A sample playbook with your inventory layout would help.