Hello,
Not sure if this is what you are after?
static:multipush kikitux$ vagrant push db
static:multipush kikitux$ vagrant push web
static:multipush kikitux$ vagrant push
The Vagrantfile defines more than one 'push' strategy. Please specify a
strategy. Defined strategy names are:
["web", "db"]
the scripts are run locally on the box, so you can call whatever
command you require.. here I am just doing date > file
Vagrant.configure("2") do |config|
#next will run in all instances, since is config.*
config.vm.provision "shell", inline: "echo Hello"
config.vm.define "web" do |web|
web.vm.box = "hashicorp/precise64"
#next will run only on web, since is web.*
web.vm.provision "shell", inline: "echo Hello from $HOSTNAME"
end
config.vm.define "db" do |db|
#next will run only on db, since is db.*
db.vm.provision "shell", inline: "echo Hello from $HOSTNAME"
db.vm.box = "hashicorp/precise64"
end
config.push.define "web", strategy: "local-exec" do |push|
push.inline = <<-SCRIPT
date > web
SCRIPT
end
config.push.define "db", strategy: "local-exec" do |push|
push.inline = <<-SCRIPT
date > db
SCRIPT
end
end
> --
> 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
vagrant-up+...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.