When managing Windows with Chef, there are some Windows-specific resources that are available to you as part of the Windows stack. This section covers those resources that are specific to Windows such as the Windows Registry, roles, MSIs, and so on; the ones that won't be available on Linux systems.
Working with Windows-specific resources
Most systems administrators, managing Windows means that there are resources and configuration data that are not available to nonWindows systems. A list of those resources includes the following:
- Roles and features
- Batch scripts
- Autorun scripts
- Software packages (MSIs, installers, and so on)
- Registry manipulation
- Tasks (requires Windows Server 2008)
- System reboots
- ZIP files
Windows Resources for Chef - Platforms supported by Chef
Not all versions of Windows are supported by Chef, and not all functionality is supported on all platforms. A list of Windows versions known to work with Chef is as follows:
Windows Server 2003 R2
Windows Server 2008
Windows Server 2012
These resources are provided by the windows cookbook and behave like any other Chef resource apart from the fact that they are platform-specific resources and have no providers on non-Windows systems. Let's take a look at these in detail, with examples of how to use them.
In order to use the windows cookbook, you need to have a few dependencies installed, specifically the chef_handler and powershell recipes.
Note: We cannot specifically depend on Chef's powershell cookbook because powershell depends on this cookbookthis creates a circular dependency if you are not careful. As a result, do not add a dependency, but rather ensure that recipe[powershell] exists in the node's expanded run list.