I have been messing around with ansible as part of my vagrant process to build boxes. My current setup is: build packer image, then import that image with vagrant.
Within my vagrantfile, i call the box I created.
That works well.
The second part is leveraging ansible in the next flow.
I can call ansible within the vagrantfile, which I have tested and worked well.
I can run ansible from the host against the vagrant boxes (i use multi-vm setups)
Some of my boxes are ‘tiered’ setups which require different packages to be installed.
Knowing that, is it safe to say, due to my requirement you can do it one of two ways:
1.) When using ansible as a post provisioner, i would create different playbooks as needed, and call the specific playbooks within the specific BOX creation portion of the vagrant file?
2.) Second option is, do this all within ansible itself once the boxes are up, run it from the host against the boxes.
With option 2, there is a need to manage the ansible inventory file, which is an extra step.
Does that make sense?
Anyone have any thoughts/experiences on the two above (or something different)?