knife-windows 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +5 -5
- data/.travis.yml +26 -26
- data/CHANGELOG.md +112 -108
- data/DOC_CHANGES.md +14 -14
- data/Gemfile +12 -12
- data/LICENSE +201 -201
- data/README.md +391 -385
- data/RELEASE_NOTES.md +34 -34
- data/Rakefile +21 -21
- data/appveyor.yml +42 -42
- data/ci.gemfile +15 -15
- data/features/knife_help.feature +20 -20
- data/features/support/env.rb +5 -5
- data/knife-windows.gemspec +25 -25
- data/lib/chef/knife/bootstrap/windows-chef-client-msi.erb +233 -247
- data/lib/chef/knife/bootstrap_windows_base.rb +449 -415
- data/lib/chef/knife/bootstrap_windows_ssh.rb +115 -115
- data/lib/chef/knife/bootstrap_windows_winrm.rb +95 -95
- data/lib/chef/knife/core/windows_bootstrap_context.rb +372 -366
- data/lib/chef/knife/knife_windows_base.rb +33 -33
- data/lib/chef/knife/windows_cert_generate.rb +155 -155
- data/lib/chef/knife/windows_cert_install.rb +68 -68
- data/lib/chef/knife/windows_helper.rb +36 -36
- data/lib/chef/knife/windows_listener_create.rb +107 -107
- data/lib/chef/knife/winrm.rb +122 -122
- data/lib/chef/knife/winrm_base.rb +117 -117
- data/lib/chef/knife/winrm_knife_base.rb +305 -303
- data/lib/chef/knife/winrm_session.rb +88 -87
- data/lib/chef/knife/winrm_shared_options.rb +47 -47
- data/lib/chef/knife/wsman_endpoint.rb +44 -44
- data/lib/chef/knife/wsman_test.rb +117 -117
- data/lib/knife-windows/path_helper.rb +234 -234
- data/lib/knife-windows/version.rb +6 -6
- data/spec/assets/win_template_rendered_with_bootstrap_install_command.txt +217 -217
- data/spec/assets/win_template_rendered_with_bootstrap_install_command_on_12_5_client.txt +217 -217
- data/spec/assets/win_template_rendered_without_bootstrap_install_command.txt +329 -329
- data/spec/assets/win_template_rendered_without_bootstrap_install_command_on_12_5_client.txt +329 -329
- data/spec/assets/win_template_unrendered.txt +246 -246
- data/spec/functional/bootstrap_download_spec.rb +241 -234
- data/spec/spec_helper.rb +94 -93
- data/spec/unit/knife/bootstrap_options_spec.rb +155 -155
- data/spec/unit/knife/bootstrap_template_spec.rb +98 -92
- data/spec/unit/knife/bootstrap_windows_winrm_spec.rb +341 -295
- data/spec/unit/knife/core/windows_bootstrap_context_spec.rb +177 -177
- data/spec/unit/knife/windows_cert_generate_spec.rb +90 -90
- data/spec/unit/knife/windows_cert_install_spec.rb +51 -51
- data/spec/unit/knife/windows_listener_create_spec.rb +76 -76
- data/spec/unit/knife/winrm_session_spec.rb +65 -65
- data/spec/unit/knife/winrm_spec.rb +516 -516
- data/spec/unit/knife/wsman_test_spec.rb +202 -202
- metadata +23 -4
data/RELEASE_NOTES.md
CHANGED
@@ -1,34 +1,34 @@
|
|
1
|
-
<!---
|
2
|
-
This file is reset every time a new release is done. The contents of this file are for the currently unreleased version.
|
3
|
-
|
4
|
-
Example Note:
|
5
|
-
|
6
|
-
## Example Heading
|
7
|
-
Details about the thing that changed that needs to get included in the Release Notes in markdown.
|
8
|
-
-->
|
9
|
-
# knife-windows 1.1.0 release notes:
|
10
|
-
This release of knife-windows includes an important fix for an
|
11
|
-
incompatibility issue with Chef Client 12.5 during bootstrap. If you
|
12
|
-
are running knife-windows 1.0.0, please upgrade to this version. See
|
13
|
-
the following issue for details: https://github.com/chef/knife-windows/pull/302
|
14
|
-
|
15
|
-
You can install this version using the `gem` command:
|
16
|
-
|
17
|
-
gem install knife-windows
|
18
|
-
|
19
|
-
## Reporting issues and contributing
|
20
|
-
`knife-windows` issues like those addressed in this release should be reported in the ticketing system at https://github.com/chef/knife-windows/issues. You can learn more about how to contribute features and bug fixes to `knife-windows` in the [Chef Contributions document](http://docs.chef.io/community_contributions.html).
|
21
|
-
|
22
|
-
## New features -- proxy support for WinRM
|
23
|
-
The `winrm` and `bootstrap windows winrm` subcommands now honor the
|
24
|
-
proxy server configured via the `http_proxy` setting in `knife.rb` for
|
25
|
-
WinRM traffic.
|
26
|
-
|
27
|
-
## Issues fixed in knife-windows 1.1.0
|
28
|
-
See the [knife-windows 1.1.0 CHANGELOG](https://github.com/chef/knife-windows/blob/1.1.0/CHANGELOG.md)
|
29
|
-
for the list of issues fixed in this release.
|
30
|
-
|
31
|
-
## knife-windows on RubyGems and Github
|
32
|
-
https://rubygems.org/gems/knife-windows
|
33
|
-
https://github.com/chef/knife-windows
|
34
|
-
|
1
|
+
<!---
|
2
|
+
This file is reset every time a new release is done. The contents of this file are for the currently unreleased version.
|
3
|
+
|
4
|
+
Example Note:
|
5
|
+
|
6
|
+
## Example Heading
|
7
|
+
Details about the thing that changed that needs to get included in the Release Notes in markdown.
|
8
|
+
-->
|
9
|
+
# knife-windows 1.1.0 release notes:
|
10
|
+
This release of knife-windows includes an important fix for an
|
11
|
+
incompatibility issue with Chef Client 12.5 during bootstrap. If you
|
12
|
+
are running knife-windows 1.0.0, please upgrade to this version. See
|
13
|
+
the following issue for details: https://github.com/chef/knife-windows/pull/302
|
14
|
+
|
15
|
+
You can install this version using the `gem` command:
|
16
|
+
|
17
|
+
gem install knife-windows
|
18
|
+
|
19
|
+
## Reporting issues and contributing
|
20
|
+
`knife-windows` issues like those addressed in this release should be reported in the ticketing system at https://github.com/chef/knife-windows/issues. You can learn more about how to contribute features and bug fixes to `knife-windows` in the [Chef Contributions document](http://docs.chef.io/community_contributions.html).
|
21
|
+
|
22
|
+
## New features -- proxy support for WinRM
|
23
|
+
The `winrm` and `bootstrap windows winrm` subcommands now honor the
|
24
|
+
proxy server configured via the `http_proxy` setting in `knife.rb` for
|
25
|
+
WinRM traffic.
|
26
|
+
|
27
|
+
## Issues fixed in knife-windows 1.1.0
|
28
|
+
See the [knife-windows 1.1.0 CHANGELOG](https://github.com/chef/knife-windows/blob/1.1.0/CHANGELOG.md)
|
29
|
+
for the list of issues fixed in this release.
|
30
|
+
|
31
|
+
## knife-windows on RubyGems and Github
|
32
|
+
https://rubygems.org/gems/knife-windows
|
33
|
+
https://github.com/chef/knife-windows
|
34
|
+
|
data/Rakefile
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
require 'bundler'
|
2
|
-
Bundler::GemHelper.install_tasks
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rspec/core/rake_task'
|
6
|
-
|
7
|
-
task :default => [:unit_spec, :functional_spec]
|
8
|
-
|
9
|
-
desc "Run all functional specs in spec directory"
|
10
|
-
RSpec::Core::RakeTask.new(:functional_spec) do |t|
|
11
|
-
t.pattern = 'spec/functional/**/*_spec.rb'
|
12
|
-
end
|
13
|
-
|
14
|
-
desc "Run all unit specs in spec directory"
|
15
|
-
RSpec::Core::RakeTask.new(:unit_spec) do |t|
|
16
|
-
t.pattern = 'spec/unit/**/*_spec.rb'
|
17
|
-
end
|
18
|
-
|
19
|
-
rescue LoadError
|
20
|
-
STDERR.puts "\n*** RSpec not available. (sudo) gem install rspec to run unit tests. ***\n\n"
|
21
|
-
end
|
1
|
+
require 'bundler'
|
2
|
+
Bundler::GemHelper.install_tasks
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rspec/core/rake_task'
|
6
|
+
|
7
|
+
task :default => [:unit_spec, :functional_spec]
|
8
|
+
|
9
|
+
desc "Run all functional specs in spec directory"
|
10
|
+
RSpec::Core::RakeTask.new(:functional_spec) do |t|
|
11
|
+
t.pattern = 'spec/functional/**/*_spec.rb'
|
12
|
+
end
|
13
|
+
|
14
|
+
desc "Run all unit specs in spec directory"
|
15
|
+
RSpec::Core::RakeTask.new(:unit_spec) do |t|
|
16
|
+
t.pattern = 'spec/unit/**/*_spec.rb'
|
17
|
+
end
|
18
|
+
|
19
|
+
rescue LoadError
|
20
|
+
STDERR.puts "\n*** RSpec not available. (sudo) gem install rspec to run unit tests. ***\n\n"
|
21
|
+
end
|
data/appveyor.yml
CHANGED
@@ -1,42 +1,42 @@
|
|
1
|
-
version: "master-{build}"
|
2
|
-
|
3
|
-
os: Windows Server 2012
|
4
|
-
platform:
|
5
|
-
- x64
|
6
|
-
|
7
|
-
environment:
|
8
|
-
bundle_gemfile: ci.gemfile
|
9
|
-
|
10
|
-
matrix:
|
11
|
-
- ruby_version: "193"
|
12
|
-
chef_version: "< 12"
|
13
|
-
|
14
|
-
- ruby_version: "200"
|
15
|
-
chef_version: "< 12"
|
16
|
-
|
17
|
-
- ruby_version: "200"
|
18
|
-
chef_version: "~> 12.0"
|
19
|
-
|
20
|
-
- ruby_version: "200"
|
21
|
-
chef_version: "master"
|
22
|
-
|
23
|
-
clone_folder: c:\projects\knife-windows
|
24
|
-
clone_depth: 1
|
25
|
-
branches:
|
26
|
-
only:
|
27
|
-
- master
|
28
|
-
|
29
|
-
install:
|
30
|
-
- winrm quickconfig -q
|
31
|
-
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
|
32
|
-
- echo %PATH%
|
33
|
-
- ruby --version
|
34
|
-
- gem --version
|
35
|
-
- gem install bundler --quiet --no-ri --no-rdoc
|
36
|
-
- bundler --version
|
37
|
-
|
38
|
-
build_script:
|
39
|
-
- bundle install || bundle install || bundle install
|
40
|
-
|
41
|
-
test_script:
|
42
|
-
- bundle exec rake
|
1
|
+
version: "master-{build}"
|
2
|
+
|
3
|
+
os: Windows Server 2012
|
4
|
+
platform:
|
5
|
+
- x64
|
6
|
+
|
7
|
+
environment:
|
8
|
+
bundle_gemfile: ci.gemfile
|
9
|
+
|
10
|
+
matrix:
|
11
|
+
- ruby_version: "193"
|
12
|
+
chef_version: "< 12"
|
13
|
+
|
14
|
+
- ruby_version: "200"
|
15
|
+
chef_version: "< 12"
|
16
|
+
|
17
|
+
- ruby_version: "200"
|
18
|
+
chef_version: "~> 12.0"
|
19
|
+
|
20
|
+
- ruby_version: "200"
|
21
|
+
chef_version: "master"
|
22
|
+
|
23
|
+
clone_folder: c:\projects\knife-windows
|
24
|
+
clone_depth: 1
|
25
|
+
branches:
|
26
|
+
only:
|
27
|
+
- master
|
28
|
+
|
29
|
+
install:
|
30
|
+
- winrm quickconfig -q
|
31
|
+
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
|
32
|
+
- echo %PATH%
|
33
|
+
- ruby --version
|
34
|
+
- gem --version
|
35
|
+
- gem install bundler --quiet --no-ri --no-rdoc
|
36
|
+
- bundler --version
|
37
|
+
|
38
|
+
build_script:
|
39
|
+
- bundle install || bundle install || bundle install
|
40
|
+
|
41
|
+
test_script:
|
42
|
+
- bundle exec rake
|
data/ci.gemfile
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
source "https://rubygems.org"
|
2
|
-
|
3
|
-
# Specify your gem's dependencies in knife-windows.gemspec
|
4
|
-
gemspec
|
5
|
-
|
6
|
-
if ENV['CHEF_VERSION'] == 'master'
|
7
|
-
gem 'chef', github: 'chef/chef'
|
8
|
-
else
|
9
|
-
gem 'chef', ENV['CHEF_VERSION']
|
10
|
-
end
|
11
|
-
|
12
|
-
gem "rspec", '~> 3.0'
|
13
|
-
gem "ruby-wmi"
|
14
|
-
gem "httpclient"
|
15
|
-
gem 'rake'
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in knife-windows.gemspec
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
if ENV['CHEF_VERSION'] == 'master'
|
7
|
+
gem 'chef', github: 'chef/chef'
|
8
|
+
else
|
9
|
+
gem 'chef', ENV['CHEF_VERSION']
|
10
|
+
end
|
11
|
+
|
12
|
+
gem "rspec", '~> 3.0'
|
13
|
+
gem "ruby-wmi"
|
14
|
+
gem "httpclient"
|
15
|
+
gem 'rake'
|
data/features/knife_help.feature
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
Feature: Ensure that the help works as designed
|
2
|
-
In order to test the help via CLI
|
3
|
-
As an Operator
|
4
|
-
I want to run the CLI with different arguments
|
5
|
-
|
6
|
-
Scenario: Running the windows sub-command shows available commands
|
7
|
-
When I run `knife windows`
|
8
|
-
And the output should contain "Available windows subcommands: (for details, knife SUB-COMMAND --help)\n\n** WINDOWS COMMANDS **\nknife bootstrap windows winrm FQDN (options)\nknife bootstrap windows ssh FQDN (options)\nknife winrm QUERY COMMAND (options)"
|
9
|
-
|
10
|
-
Scenario: Running the windows sub-command shows available commands
|
11
|
-
When I run `knife windows --help`
|
12
|
-
And the output should contain "Available windows subcommands: (for details, knife SUB-COMMAND --help)\n\n** WINDOWS COMMANDS **\nknife bootstrap windows winrm FQDN (options)\nknife bootstrap windows ssh FQDN (options)\nknife winrm QUERY COMMAND (options)"
|
13
|
-
|
14
|
-
Scenario: Running the windows sub-command shows available commands
|
15
|
-
When I run `knife windows help`
|
16
|
-
And the output should contain "Available windows subcommands: (for details, knife SUB-COMMAND --help)\n\n** WINDOWS COMMANDS **\nknife bootstrap windows winrm FQDN (options)\nknife bootstrap windows ssh FQDN (options)\nknife winrm QUERY COMMAND (options)"
|
17
|
-
|
18
|
-
Scenario: Running the knife command shows available windows command"
|
19
|
-
When I run `knife`
|
20
|
-
And the output should contain "** WINDOWS COMMANDS **\nknife bootstrap windows winrm FQDN (options)\nknife bootstrap windows ssh FQDN (options)\nknife winrm QUERY COMMAND (options)"
|
1
|
+
Feature: Ensure that the help works as designed
|
2
|
+
In order to test the help via CLI
|
3
|
+
As an Operator
|
4
|
+
I want to run the CLI with different arguments
|
5
|
+
|
6
|
+
Scenario: Running the windows sub-command shows available commands
|
7
|
+
When I run `knife windows`
|
8
|
+
And the output should contain "Available windows subcommands: (for details, knife SUB-COMMAND --help)\n\n** WINDOWS COMMANDS **\nknife bootstrap windows winrm FQDN (options)\nknife bootstrap windows ssh FQDN (options)\nknife winrm QUERY COMMAND (options)"
|
9
|
+
|
10
|
+
Scenario: Running the windows sub-command shows available commands
|
11
|
+
When I run `knife windows --help`
|
12
|
+
And the output should contain "Available windows subcommands: (for details, knife SUB-COMMAND --help)\n\n** WINDOWS COMMANDS **\nknife bootstrap windows winrm FQDN (options)\nknife bootstrap windows ssh FQDN (options)\nknife winrm QUERY COMMAND (options)"
|
13
|
+
|
14
|
+
Scenario: Running the windows sub-command shows available commands
|
15
|
+
When I run `knife windows help`
|
16
|
+
And the output should contain "Available windows subcommands: (for details, knife SUB-COMMAND --help)\n\n** WINDOWS COMMANDS **\nknife bootstrap windows winrm FQDN (options)\nknife bootstrap windows ssh FQDN (options)\nknife winrm QUERY COMMAND (options)"
|
17
|
+
|
18
|
+
Scenario: Running the knife command shows available windows command"
|
19
|
+
When I run `knife`
|
20
|
+
And the output should contain "** WINDOWS COMMANDS **\nknife bootstrap windows winrm FQDN (options)\nknife bootstrap windows ssh FQDN (options)\nknife winrm QUERY COMMAND (options)"
|
data/features/support/env.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require 'aruba/cucumber'
|
2
|
-
|
3
|
-
Before do
|
4
|
-
@aruba_timeout_seconds = 5
|
5
|
-
end
|
1
|
+
require 'aruba/cucumber'
|
2
|
+
|
3
|
+
Before do
|
4
|
+
@aruba_timeout_seconds = 5
|
5
|
+
end
|
data/knife-windows.gemspec
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "knife-windows/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = "knife-windows"
|
7
|
-
s.version = Knife::Windows::VERSION
|
8
|
-
s.platform = Gem::Platform::RUBY
|
9
|
-
s.authors = ["Seth Chisamore"]
|
10
|
-
s.email = ["schisamo@chef.io"]
|
11
|
-
s.license = "Apache-2.0"
|
12
|
-
s.homepage = "https://github.com/chef/knife-windows"
|
13
|
-
s.summary = %q{Plugin that adds functionality to Chef's Knife CLI for configuring/interacting with nodes running Microsoft Windows}
|
14
|
-
s.description = s.summary
|
15
|
-
|
16
|
-
s.required_ruby_version = ">= 1.9.1"
|
17
|
-
s.add_dependency "winrm", "~> 1.7"
|
18
|
-
|
19
|
-
s.add_development_dependency 'pry'
|
20
|
-
|
21
|
-
s.files = `git ls-files`.split("\n")
|
22
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
23
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
24
|
-
s.require_paths = ["lib"]
|
25
|
-
end
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "knife-windows/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "knife-windows"
|
7
|
+
s.version = Knife::Windows::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Seth Chisamore"]
|
10
|
+
s.email = ["schisamo@chef.io"]
|
11
|
+
s.license = "Apache-2.0"
|
12
|
+
s.homepage = "https://github.com/chef/knife-windows"
|
13
|
+
s.summary = %q{Plugin that adds functionality to Chef's Knife CLI for configuring/interacting with nodes running Microsoft Windows}
|
14
|
+
s.description = s.summary
|
15
|
+
|
16
|
+
s.required_ruby_version = ">= 1.9.1"
|
17
|
+
s.add_dependency "winrm", "~> 1.7"
|
18
|
+
|
19
|
+
s.add_development_dependency 'pry'
|
20
|
+
|
21
|
+
s.files = `git ls-files`.split("\n")
|
22
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
23
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
24
|
+
s.require_paths = ["lib"]
|
25
|
+
end
|