0

So I'm looking at creating a generic wrapper around the ansible-playbook command. What I'd like to do is spin up a number of VMs (Vagrant or docker), based on the inventory supplied.

I'd use these VMs locally for automated testing using molecule, as well as manual function testing.

Crucially the number of machines in the inventory could change, so these need created prior to the run.

Any thoughts?

Cheers, Stuart

Stuart Milton
  • 63
  • 2
  • 6

1 Answers1

0

You could use a tool like Terraform to run your docker images, and then export the inventory from Terraform to Ansible using something like terraform-inventory.

I think there's also an Ansible provisioner for Terraform.

Kraylog
  • 7,383
  • 1
  • 24
  • 35
  • Thanks for that, I'll have a look at that. I'm actually wondering if I could have an [all] group in my inventory, and then have a role run locally that spins up the docker containers. Hmm.... – Stuart Milton Aug 21 '17 at 17:16