Skip to content

simple vagrant provisioner that executes commands on the host

License

Notifications You must be signed in to change notification settings

phinze/vagrant-host-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vagrant-host-shell plugin

a vagrant provisioner to run commands on the host when a VM boots.

simple example based on question asked on vagrant mailing list

example usage

Install as a plugin:

vagrant plugin install vagrant-host-shell

Add this to Vagrantfile:

  config.vm.provision :host_shell do |host_shell|
    host_shell.inline = 'touch /tmp/hostshell-works && echo hello from the host && hostname 1>&2'
  end

Run vagrant up (or vagrant provision if machine is already running.)

Observe that /tmp/hostshell-works is present on your host, and that the provisioner output:

[stdout] hello from the host
[stderr] (your host's hostname)

About

simple vagrant provisioner that executes commands on the host

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages