DescriptionThis Knife Plugin adds additional functionality to the Chef Knife CLI tool for configuring/interacting with nodes running Microsoft Windows.The subcommands should function on any system running Ruby 1.9.1+ but nodes being configured via these subcommands require Windows Remote Management (WinRM) 1.0+. WinRM allows you to call native objects in Windows, which includes, but is not limited to:
For more information on WinRM, please visit Microsoft's WinRM site. You will want to familiarize yourself with (certain key aspects) of WinRM because you will be writing scripts/running commands with this tool to get you from (specific point A) to (specific point B). WinRM is built into Windows 7 and Windows Server 2008+. It can also be easily installed in older version of Windows, including:
More information can be found on Microsoft Support article 968930. |
|
Requirements/Version
On 2008R1 and earlier, windows defaults to using port 80 for winrm HTTP and 443 for winrm HTTPS. To change winrm to used HTTP on port InstallationKnife Plugins ship as Ruby gems so knife-windows is easily installable. Since knife-windows is written in pure Ruby (just like Chef) you should be able to install it on any platform that Chef supports. This means you can manage your Windows nodes from the comfort of bash on your favorite Linux distro or better yet zsh on OS X if you'd like! SubcommandsThis plugin provides the following Knife subcommands. Specific command options can be found by invoking the subcommand with a ---help flag. knife winrmThe winrm subcommand allows you to invoke commands in parallel on a subset of the nodes in your infrastructure. The winrm subcommand uses the same syntax as the search subcommand; you could could find the uptime of all your web servers using the command: You could also invoke everyone's favorite Windows command ipconfig against a single server (vs a search query in the prior example) using the following command: Or force a chef run: This subcommand operates in a very similar manner as knife ssh leveraging the WinRM protocol for communication. It also include’s knife ssh’s "interactive session mode" knife bootstrap windows winrmPerforms a Chef Bootstrap (via the WinRM protocol) on the target node. The goal of the bootstrap is to get Chef installed on the target system so it can run Chef Client with a Chef Server. The main assumption is a baseline OS installation exists. It is primarily intended for Chef Client systems that talk to a Chef server. In the future this subcommand will be used internally by some cloud computing server create commands like the current knife bootstrap subcommand is. This subcommand operates in a very similar manner as knife bootstrap leveraging the WinRM protocol for communication. An initial run_list for the node can also be passed to the subcommand. Example usage: knife bootstrap windows sshPerforms a Chef Bootstrap (via the SSH protocol) on the target node. The goal of the bootstrap is to get Chef installed on the target system so it can run Chef Client with a Chef Server. The main assumption is a baseline OS installation exists. It is primarily intended for Chef Client systems that talk to a Chef server. This subcommand assumes the SSH session will use Windows native cmd.exe command shell vs a bash shell through an emulated cygwin layer. Most popular Windows based SSHd daemons like freeSSHd and WinSSHD behave this way. An initial run_list for the node can also be passed to the subcommand. Example usage: Bootstrap TemplatesThis gem provides the following bootstrap templates: windows-chef-client-msiThis bootstrap template does the following:
This is the default bootstrap template used by both the windows bootstrap subcommands. windows-shellThis bootstrap template does the following:
This should be considered a legacy bootstrap template and will most likely be removed in a future version.
|
|
|

