Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

Automatically add route on box start #5

Open
hanikesn opened this issue Jan 16, 2017 · 3 comments
Open

Automatically add route on box start #5

hanikesn opened this issue Jan 16, 2017 · 3 comments

Comments

@hanikesn
Copy link
Contributor

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).

@mente
Copy link
Member

mente commented Jan 16, 2017

Automatic provision on start?

@hanikesn
Copy link
Contributor Author

It's not really provisioning as the route command needs to be executed on the host itself with sudo.

@ph-teven
Copy link

ph-teven commented Jul 3, 2017

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'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants