Open hanikesn opened 7 years ago
Automatic provision on start?
It's not really provisioning as the route command needs to be executed on the host itself with sudo.
maybe this would help. put this in your Vagrantfile.
module LocalCommand
class Config < Vagrant.plugin("2", :config)
attr_accessor :command
end
class Plugin < Vagrant.plugin("2")
name "local_shell"
config(:local_shell, :provisioner) do
Config
end
provisioner(:local_shell) do
Provisioner
end
end
class Provisioner < Vagrant.plugin("2", :provisioner)
def provision
result = system "#{config.command}"
end
end
end
k8s.vm.provision "access",
type: "local_shell",
command: "#route command#",
run: 'always'
People often forget adding the route or have typos in their command. Therefore the box should add the correct routes automatically (with the option to turn that off).