{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/vagrant/issues/9840","repository_url":"https://api.github.com/repos/hashicorp/vagrant","labels_url":"https://api.github.com/repos/hashicorp/vagrant/issues/9840/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/vagrant/issues/9840/comments","events_url":"https://api.github.com/repos/hashicorp/vagrant/issues/9840/events","html_url":"https://github.com/hashicorp/vagrant/issues/9840","id":323458227,"node_id":"MDU6SXNzdWUzMjM0NTgyMjc=","number":9840,"title":"Support ruby code for trigger execution","user":{"login":"john2x","id":332885,"node_id":"MDQ6VXNlcjMzMjg4NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/332885?v=4","gravatar_id":"","url":"https://api.github.com/users/john2x","html_url":"https://github.com/john2x","followers_url":"https://api.github.com/users/john2x/followers","following_url":"https://api.github.com/users/john2x/following{/other_user}","gists_url":"https://api.github.com/users/john2x/gists{/gist_id}","starred_url":"https://api.github.com/users/john2x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/john2x/subscriptions","organizations_url":"https://api.github.com/users/john2x/orgs","repos_url":"https://api.github.com/users/john2x/repos","events_url":"https://api.github.com/users/john2x/events{/privacy}","received_events_url":"https://api.github.com/users/john2x/received_events","type":"User","site_admin":false},"labels":[{"id":54082731,"node_id":"MDU6TGFiZWw1NDA4MjczMQ==","url":"https://api.github.com/repos/hashicorp/vagrant/labels/enhancement","name":"enhancement","color":"207de5","default":true},{"id":922836310,"node_id":"MDU6TGFiZWw5MjI4MzYzMTA=","url":"https://api.github.com/repos/hashicorp/vagrant/labels/triggers","name":"triggers","color":"2bdbc0","default":false}],"state":"closed","locked":false,"assignee":{"login":"briancain","id":810277,"node_id":"MDQ6VXNlcjgxMDI3Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/810277?v=4","gravatar_id":"","url":"https://api.github.com/users/briancain","html_url":"https://github.com/briancain","followers_url":"https://api.github.com/users/briancain/followers","following_url":"https://api.github.com/users/briancain/following{/other_user}","gists_url":"https://api.github.com/users/briancain/gists{/gist_id}","starred_url":"https://api.github.com/users/briancain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briancain/subscriptions","organizations_url":"https://api.github.com/users/briancain/orgs","repos_url":"https://api.github.com/users/briancain/repos","events_url":"https://api.github.com/users/briancain/events{/privacy}","received_events_url":"https://api.github.com/users/briancain/received_events","type":"User","site_admin":false},"assignees":[{"login":"briancain","id":810277,"node_id":"MDQ6VXNlcjgxMDI3Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/810277?v=4","gravatar_id":"","url":"https://api.github.com/users/briancain","html_url":"https://github.com/briancain","followers_url":"https://api.github.com/users/briancain/followers","following_url":"https://api.github.com/users/briancain/following{/other_user}","gists_url":"https://api.github.com/users/briancain/gists{/gist_id}","starred_url":"https://api.github.com/users/briancain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briancain/subscriptions","organizations_url":"https://api.github.com/users/briancain/orgs","repos_url":"https://api.github.com/users/briancain/repos","events_url":"https://api.github.com/users/briancain/events{/privacy}","received_events_url":"https://api.github.com/users/briancain/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/hashicorp/vagrant/milestones/37","html_url":"https://github.com/hashicorp/vagrant/milestone/37","labels_url":"https://api.github.com/repos/hashicorp/vagrant/milestones/37/labels","id":3646695,"node_id":"MDk6TWlsZXN0b25lMzY0NjY5NQ==","number":37,"title":"2.1.6","description":"","creator":{"login":"chrisroberts","id":266674,"node_id":"MDQ6VXNlcjI2NjY3NA==","avatar_url":"https://avatars1.githubusercontent.com/u/266674?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisroberts","html_url":"https://github.com/chrisroberts","followers_url":"https://api.github.com/users/chrisroberts/followers","following_url":"https://api.github.com/users/chrisroberts/following{/other_user}","gists_url":"https://api.github.com/users/chrisroberts/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisroberts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisroberts/subscriptions","organizations_url":"https://api.github.com/users/chrisroberts/orgs","repos_url":"https://api.github.com/users/chrisroberts/repos","events_url":"https://api.github.com/users/chrisroberts/events{/privacy}","received_events_url":"https://api.github.com/users/chrisroberts/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":18,"state":"open","created_at":"2018-09-11T22:50:40Z","updated_at":"2018-10-08T16:02:31Z","due_on":null,"closed_at":null},"comments":19,"created_at":"2018-05-16T03:40:34Z","updated_at":"2018-10-08T18:33:53Z","closed_at":"2018-10-08T16:02:31Z","author_association":"NONE","body":"\r\n### Vagrant version\r\n\r\n```\r\n$ vagrant -v\r\nVagrant 2.1.1\r\n```\r\n\r\n### Host operating system\r\nThis is the operating system that you run locally.\r\n```\r\n$ uname -a\r\nLinux arch 4.16.8-1-ARCH #1 SMP PREEMPT Wed May 9 11:25:02 UTC 2018 x86_64 GNU/Linux\r\n```\r\n\r\n### Guest operating system\r\nThis is the operating system you run in the virtual machine.\r\n```\r\n$ uname -a\r\nLinux vagrant-triggers-test 4.4.0-104-generic #127-Ubuntu SMP Mon Dec 11 12:16:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux\r\n```\r\n\r\n### Vagrantfile\r\n```ruby\r\n# -*- mode: ruby -*-\r\n# vi: set ft=ruby :\r\n\r\nVagrant.configure(\"2\") do |config|\r\n  config.vm.box = \"ubuntu/xenial64\"\r\n  config.vm.box_check_update = false\r\n  config.vm.hostname = \"vagrant-triggers-test\"\r\n\r\n  config.trigger.before :up do |trigger|\r\n    trigger.info = 'test before up'\r\n    trigger.name = 'test before up'\r\n    print \"Hello I am before up trigger\"\r\n  end\r\n\r\nend\r\n\r\n```\r\n\r\n### Debug output\r\nhttps://gist.github.com/john2x/891a83d965df6e085bf438a9f5338303\r\n\r\n### Expected behavior\r\nThe `vagrant halt` command should not have printed the message defined in the `config.trigger.before :up` block.\r\n\r\n### Actual behavior\r\nThe `vagrant halt` command executed the trigger code intended only for the `up` command.\r\n\r\n### Steps to reproduce\r\n1. Copy Vagrantfile\r\n2. `vagrant up`\r\n3. `vagrant halt`\r\n\r\n### References\r\nNone"},"comment":{"url":"https://api.github.com/repos/hashicorp/vagrant/issues/comments/427936554","html_url":"https://github.com/hashicorp/vagrant/issues/9840#issuecomment-427936554","issue_url":"https://api.github.com/repos/hashicorp/vagrant/issues/9840","id":427936554,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzkzNjU1NA==","user":{"login":"briancain","id":810277,"node_id":"MDQ6VXNlcjgxMDI3Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/810277?v=4","gravatar_id":"","url":"https://api.github.com/users/briancain","html_url":"https://github.com/briancain","followers_url":"https://api.github.com/users/briancain/followers","following_url":"https://api.github.com/users/briancain/following{/other_user}","gists_url":"https://api.github.com/users/briancain/gists{/gist_id}","starred_url":"https://api.github.com/users/briancain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briancain/subscriptions","organizations_url":"https://api.github.com/users/briancain/orgs","repos_url":"https://api.github.com/users/briancain/repos","events_url":"https://api.github.com/users/briancain/events{/privacy}","received_events_url":"https://api.github.com/users/briancain/received_events","type":"User","site_admin":false},"created_at":"2018-10-08T18:33:53Z","updated_at":"2018-10-08T18:33:53Z","author_association":"MEMBER","body":"Hey everyone! Thanks for all the feedback on this issue. I've written up the change via #10267 , and it should be out in the next release of Vagrant. All of your examples and requests were super useful. You should also now have access to the `machine` object inside a ruby trigger."}}
{"actor":{"display_login":"briancain"}}