From 1b22d55f6351c6165382d24165bf7ef5f39462b0 Mon Sep 17 00:00:00 2001 From: Doug Ireton Date: Tue, 10 May 2016 22:09:59 -0700 Subject: [PATCH] Install the vagrant-winrm plugin This eliminates a confusing manual step for anyone who wants to test with Windows guests. Fix #93 --- CHANGELOG.md | 3 +++ recipes/vagrant.rb | 2 ++ spec/unit/recipes/vagrant_spec.rb | 8 ++++++++ test/integration/default/vagrant_spec.rb | 4 ++++ 4 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6e1385..3a18a08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ * Fix [#75](https://github.com/Nordstrom/chefdk_bootstrap/issues/75): Write PowerShell profile customizations to $Profile.CurrentUserAllHosts +* Fix [#93](https://github.com/Nordstrom/chefdk_bootstrap/issues/93): + Install the vagrant-winrm plugin + ### Upgrading from 1.7 This cookbook no longer writes C:\WINDOWS\System32\WindowsPowerShell\v1.0\profile.ps1. If you are upgrading from 1.7 or earlier you will need to remove [the lines added by the chefdk_bootstrap in v1.7.0](https://github.com/Nordstrom/chefdk_bootstrap/blob/v1.7.0/templates/windows/global_profile.ps1.erb) diff --git a/recipes/vagrant.rb b/recipes/vagrant.rb index 5a25d7f..d5bb447 100644 --- a/recipes/vagrant.rb +++ b/recipes/vagrant.rb @@ -14,3 +14,5 @@ # include_recipe 'vagrant' + +vagrant_plugin 'vagrant-winrm' diff --git a/spec/unit/recipes/vagrant_spec.rb b/spec/unit/recipes/vagrant_spec.rb index ae7526e..abda743 100644 --- a/spec/unit/recipes/vagrant_spec.rb +++ b/spec/unit/recipes/vagrant_spec.rb @@ -5,6 +5,10 @@ it 'includes the vagrant::default recipe' do expect(windows_chef_run).to include_recipe('vagrant') end + + it 'installs the vagrant-winrm plugin' do + expect(windows_chef_run).to install_vagrant_plugin('vagrant-winrm') + end end context 'on a Mac' do @@ -13,5 +17,9 @@ it 'includes the vagrant::default recipe' do expect(mac_os_x_chef_run).to include_recipe('vagrant') end + + it 'installs the vagrant-winrm plugin' do + expect(mac_os_x_chef_run).to install_vagrant_plugin('vagrant-winrm') + end end end diff --git a/test/integration/default/vagrant_spec.rb b/test/integration/default/vagrant_spec.rb index fe5b154..470fe3a 100644 --- a/test/integration/default/vagrant_spec.rb +++ b/test/integration/default/vagrant_spec.rb @@ -16,3 +16,7 @@ its(:exit_status) { should eq(0) } its(:stdout) { should match(/Vagrant \d+\.\d+\.\d+/) } end + +describe command('vagrant plugin list') do + its(:stdout) { should match(/vagrant-winrm/) } +end