volanja / ansible-sample-tdd

Test Driven Development for Ansible by ServerSpec. It's Sample
94 stars 14 forks source link

[QUESTION] Support for multiple inventories #5

Open franmrl opened 8 years ago

franmrl commented 8 years ago

I currently use static inventories with the following structure in ansible:

enviro/dev/hosts
enviro/staging/hosts
enviro/live/hosts

Any idea on how should I play around .ansiblespec in order to be able to run rake -T staging or rake -T dev?

volanja commented 8 years ago

You can use environment variables with the rake command. They are listed below.

Environment variables take precedence over the .ansiblespec file.

Example:

$ INVENTORY=hosts rake serverspec:Ansible-Sample-TDD

Please try it!