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

triggers are ignored when provider is 'aws' #12

Closed russroy closed 10 years ago

russroy commented 10 years ago

If you do this

vagrant up --provider aws

with the Vagrantfile below then the trigger does not fire.

Do

vagrant up

and trigger fires as expected.

I'm guessing the 'up' is intercepted by the vagrant-aws plugin when aws is the default provider.

Any easy way around this?


Vagrant.configure("2") do |config|
  config.vm.box = "docker-server"
  config.trigger.before :up do
  confirm = nil
  until ["Y", "y", "N", "n"].include?(confirm)
    confirm = ask "Would you really like to bring up the VM? (Y/N) "
  end
  exit unless confirm.upcase == "Y"
  end

  config.vm.provider :aws do |aws, override|
  end
end
emyl commented 10 years ago

Thanks for reporting the issue. I'm actually investigating.

The bug doesn't happen only with aws, but with other providers too. So I think that this issue on vagrant-aws could be safely closed.

russroy commented 10 years ago

Ok, good stuff. This is important functionality for me. Thanks for your good work.

BTW, I'm of the belief that this sort of functionality is important enough and of general applicability so that it belongs in the Vagrant core (I've suggested it as a Vagrant enhancement.)

(I closed the issue against vagrant-aws.)

seamusabshere commented 10 years ago

(personally trying VAGRANT_DEFAULT_PROVIDER=aws vagrant up, will report back in a few)

seamusabshere commented 10 years ago

(nope, don't think that worked)

russroy commented 10 years ago

Thanks for the quick turnaround on this! On May 20, 2014 3:52 AM, "Emiliano Ticci" notifications@github.com wrote:

Closed #12 https://github.com/emyl/vagrant-triggers/issues/12 via 16e7108https://github.com/emyl/vagrant-triggers/commit/16e7108901a74f6b36cb89279129a188f001b48f .

— Reply to this email directly or view it on GitHubhttps://github.com/emyl/vagrant-triggers/issues/12#event-122784341 .

russroy commented 10 years ago

Is there any way to query the machine state within a trigger body? ...or within a Vagrantfile in general?