emyl / vagrant-triggers

Allow the definition of arbitrary scripts that will run on the host before and/or after Vagrant commands.
MIT License
546 stars 35 forks source link

Another example to add please #21

Closed kalefranz closed 9 years ago

kalefranz commented 10 years ago

Hi @emyl . Thanks for the awesome plugin. It's really very helpful.

I'm not a Ruby guy, so like a lot of other people here, examples are good. In my specific situation, writing a config.trigger.before :provision block only triggers when I run vagrant provision. I'd really like that block to hit when I run any of

Is there something straight-forward I can do to make this happen?

emyl commented 10 years ago

Hi!

That's an interesting use case! Let me think a moment how it can be implemented... :wink:

ypereirareis commented 10 years ago

Hi,

I'm interesting in this possibility or implementation too... Are you still looking at it ?

Thanks

svenXY commented 9 years ago

Hi,

I have the exact same requirement.

Specifically, I want to run jpetazzo/pipework to create additional network interfaces.

After vagrant halt && vagrant up, they are gone, thus it would be great if I could recreate them as soon as possible (i.e. before the puppet provisioner runs).

It seems currently not possible to trigger something to run

Thanks, Sven

pcriv commented 9 years ago

+1

emyl commented 9 years ago

Starting from version 0.5.0, just released, triggers could be run as a provisioner too:

config.vm.provision "trigger", :option => "value" do |trigger|
  trigger.fire do
    run "script"
  end
end
pcriv commented 9 years ago

how is this different from 'shell' provisioner?

emyl commented 9 years ago

@pablocrivella shell provisioner runs only on the guest, this one could run both on the host and the guest.

pcriv commented 9 years ago

aaah hehe right! :sweat_smile: thanks @emyl