further refined the dynamic inventory script for multiple configs