For now I have used the following workaround:
if
> File.exists?(File.expand_path('.vagrant/machines/default/virtualbox/action_provision'))
>
> then
> puts "Machine provisioned"
> else
> puts "Machine NOT provisioned"
> end
But would be great to either be able to use @env or any other solution.
Thanks!
El martes, 1 de marzo de 2016, 15:15:03 (UTC-3), Andres Montalban escribió:
>
> Hey guys,
>
> I'm in the need of detecting if vagrant has been provisioned or not, the
> goal is to ask the user if bridged network is needed but only do that on
> the first "vagrant up".
>
> I saw that you have an env variable called "provision_enable" [1] but
> can't find the way to use it inside Vagrantfile. If not implemented it
> would be great to have a method say is_provisioned? so we can do other
> things prior or after a machine is provisioned.
>
> Thank you very much for your help!
>
> Andres,
>
> --
> [1]
> https://github.com/mitchellh/vagrant/blob/master/lib/vagrant/action/builtin/provision.rb#L72
>
--
This mailing list is governed under the HashiCorp Community Guidelines -
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of
those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups
"Vagrant" 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/vagrant-up/eae8b247-d803-4617-ad66-b92360da471c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.