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

get the vm name? #73

Closed caphrim007 closed 7 years ago

caphrim007 commented 7 years ago

Is it possible to get the name of the VM that was matched upon if the config.trigger.after :up, :vm => [/something/] triggers?

For example, is it available as a parameter to the block or somewhere else??

caphrim007 commented 7 years ago

answering my own question, yes, here's an example

  config.trigger.after :up, :vm => [/ha[0-9]+/] do |m|
    puts "hi #{@machine.name}"
  end