diff --git a/CHANGELOG.md b/CHANGELOG.md index c2bd83bb7..a119bbba3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ IMPROVEMENTS: - commands/ssh-config: Works without a target in multi-machine envs [GH-2844] - guests/freebsd: Support for virtio interfaces. [GH-3082] - guests/openbsd: Support for virtio interfaces. [GH-3082] + - providers/hyperv: Implement `vagrant ssh -c` support. [GH-3615] - provisioners/ansible: Support for Ansible Vault. [GH-3338] - provisioners/ansible: Show Ansible command executed. [GH-3628] - provisioners/salt: Colorize option. [GH-3603] diff --git a/plugins/providers/hyperv/action.rb b/plugins/providers/hyperv/action.rb index 23b55cf83..de43c7b21 100644 --- a/plugins/providers/hyperv/action.rb +++ b/plugins/providers/hyperv/action.rb @@ -169,6 +169,27 @@ module VagrantPlugins end end + def self.action_ssh_run + Vagrant::Action::Builder.new.tap do |b| + b.use ConfigValidate + b.use Call, IsState, :not_created do |env, b2| + if env[:result] + b2.use Message, I18n.t("vagrant_hyperv.message_not_created") + next + end + + b2.use Call, IsState, :running do |env1, b3| + if !env1[:result] + b3.use Message, I18n.t("vagrant_hyperv.message_not_running") + next + end + + b3.use SSHRun + end + end + end + end + def self.action_suspend Vagrant::Action::Builder.new.tap do |b| b.use ConfigValidate