Quickly skimming the Vagrant Ansible provisioner docs, isn't this precisely
the behaviour you're looking for:

https://developer.hashicorp.com/vagrant/docs/provisioning/ansible#ansible-parallel-execution

    # Only execute once the Ansible provisioner,    # when all the
machines are up and ready.

So you would spin up all your Vagrant boxes from your control node, wait
for that to complete, template out a static inventory of your Vagrant boxes
then run your subsequent Vagrant Ansible provisioner automation?



On Sat, 25 Nov 2023 at 18:20, Evan Hisey <[email protected]> wrote:

> I am working on a scenario where the first playbook executes commands on a
> remote host to create a vagrant host and spins up multiple vms. Vagrant can
> triggers it's own ansible provisioning runs but they are only single host
> aware and run when the host is provisioned. That does not work in this
> case, as I need all VM's running BEFORE the deployment playbook can be
> triggered. Added wrinkle is the VMs are accessible at this time from
> outside the vagrant host. If they were, I could simply import the vagrant
> host list into the controller inventory and refresh.
>
> Right now I am looking at  the possibility of using ansible.builtin.shell
> to trigger the new ansible-playbook command on the vagrant host to run the
> vagrant VM application configuration. But while this works it is not
> exactly ansible clean. Suggestions on approaches?
>
> --
> Evan Hisey
> [email protected]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAEcFzYwsmYmvh%3DWJwSNmJWertkxFRDiKkumnwhzAFupggP58Vg%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAEcFzYwsmYmvh%3DWJwSNmJWertkxFRDiKkumnwhzAFupggP58Vg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAKtKohS2LdL4qtTyQF8VdV6pu2tjL3mx868TgvkwvAEUkRbF%3Dg%40mail.gmail.com.

Reply via email to