Book Image

Managing Windows Servers with Chef

By : John Ewart
Book Image

Managing Windows Servers with Chef

By: John Ewart

Overview of this book

<p>This book begins with an introduction to the functionality and benefits of using Chef to manage Windows systems. From there, you are shown an overview of the Chef architecture and how to prepare a Windows host so that it can be managed by Chef, followed by an example of writing code to install a popular .NET application with Chef.<br /><br />This book looks at how Windows system administrators can effectively leverage Chef as an automated system management tool to simplify their lives through managed infrastructure. Included are practical examples that will help you to understand how to take advantage of Chef when managing your infrastructure.<br /><br />By the end of the book, you will be able to deploy software, provision hosts (including cloud servers), develop and test recipes for multiple platforms, and manage Windows hosts using the powerful tools that Chef provides.</p>
Table of Contents (13 chapters)

Executing batch scripts


Similar to Linux script resources for bash, ruby, and so on, Chef can execute arbitrarily-defined Windows batch scripts through the command interpreter. When these resources are used, Chef compiles the contents of the batch script as defined in the resource block's code attribute and then deposits it on the managed host and it is executed from there.

Note

Take caution when using script resources; they are unstructured and can easily perform actions that have unintended side effects. Similar to the way the software is built, two immediate subsequent runs of the Chef client on a node should have the same effect as only running it once in order to guarantee a reliable and consistent system configuration. Make sure that you develop scripts that are idempotent in nature (that is, it can be run multiple times and have the same effect as only running once), or use conditionals to prevent multiple executions.

Since scripts are arbitrary and of a free form, you can use them to...