Created
November 22, 2016 08:38
-
-
Save anonymous/5c374e52b0fe9551043b01671683a3d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# previous https://gist.github.com/anonymous/44eee71f0d07ca824ed01918b6126f84 | |
ssh_config = my_config.vars.host_ssh_file | |
ssh_config_rm = "ssh-config-upsert rm #{machine_config.name} #{ssh_config}" | |
ssh_config_add = "ssh-config-upsert add #{ssh_config} \"vagrant ssh-config #{machine_config.name}\"" | |
config.trigger.before :reload, :vm => [machine_config.name] do | |
run ssh_config_rm if ssh_config | |
run_remote "/vagrant/vagrant-triggers/vagrant-before-reload" | |
end | |
config.trigger.after :reload, :vm => [machine_config.name] do | |
run ssh_config_add if ssh_config | |
run_remote "/vagrant/vagrant-triggers/vagrant-after-reload" | |
end | |
config.trigger.after :up, :vm => [machine_config.name] do | |
run ssh_config_add if ssh_config | |
run_remote "/vagrant/vagrant-triggers/vagrant-after-up" | |
end | |
config.trigger.before :halt, :vm => [machine_config.name] do | |
run ssh_config_rm if ssh_config | |
run_remote "/vagrant/vagrant-triggers/vagrant-before-halt" | |
end | |
config.trigger.before :suspend, :vm => [machine_config.name] do | |
run ssh_config_rm if ssh_config | |
run_remote "/vagrant/vagrant-triggers/vagrant-before-suspend" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment