You have to pass the information in as part of the vagrant up/reload process.
Through a combination of the shell provisioner or file provisioner you can accomplish what you need # Env Variable config.vm.provision "shell", inline: "EXPORT box_version = ..." or # Text File config.vm.provision "shell", inline: "echo box_version = ... > ~/bversion.txt" or #Hardcoded text file as part of some outside process config.vm.provision "file", source: "~/bversion.txt", destination: "~/bversion.txt" On Sunday, November 24, 2019 at 7:56:14 PM UTC-5, mike konovalov wrote: > > In one of the scripts that I run inside VM I need to figure out what is > the current box version. > Is it possible to bake this information inside VM somehow? Maybe some env > vars or something? > Thanks > -- 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/5622092a-07ed-4a65-ada0-4db70ade24a5%40googlegroups.com.
