GithubHelp home page GithubHelp logo

lrakai / chef-solo-windows Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 15 KB

Demonstrate using Chef Solo to configure a Windows host

License: MIT License

PowerShell 51.48% Ruby 40.97% HTML 7.55%
chef-solo chef windows berkshelf chocolatey-packages iis

chef-solo-windows's Introduction

chef-solo-windows

This repository demonstrates using Chef Solo to configure a Windows host. The commits with names beginning with Step #: go through:

  1. Configuring Chef Solo
  2. Running simple recipes that use log, windows_package, and file Chef resources
  3. Using guards to make resources idempotent
  4. Using Berkshelf to manage Chef Supermarket dependencies in order to install Chocolatey and a Chocolatey package
  5. Use a Chef Supermarket dependency to install and configure IIS to host a web site

Getting Started

An Azure RM template is included in infrastructure/ to create a virtual machine to follow along.

Using Azure PowerShell, do the following to provision the resources:

Login-AzureRmAccount
New-AzureRmResourceGroup -Name cloud-kitchen -Location "Central US"
New-AzureRmResourceGroupDeployment -Name ChefSolo -ResourceGroupName cloud-kitchen -TemplateFile .\infrastructure\arm-template.json
Get-AzureRmPublicIpAddress -Name lab-vm-ip -ResourceGroupName cloud-kitchen | Select -ExpandProperty IpAddress

Alternatively, you can perform a one-click deploy with the following button:

Remote Desktop into the virtual machine:

  • user: student
  • password: 1Lab_Virtual_Machine!

Following Along

At each commit Step #: copy the files onto the VM and run the commands described for the step in a powershell terminal.

Step 1

Run the ChefDK installer that will appear on your desktop. Verify the install by entering the following in PowerShell:

chef-solo --version

Step 2

Run the simple recipes and verify the Notepad++ installation by opening the editor:

chef-solo -o 'recipe[ca-lab::hello]'
chef-solo -o 'recipe[ca-lab::file]'
chef-solo -o 'recipe[ca-lab::editor]'
& 'C:\Program Files\Notepad++\notepad++.exe'

Step 3

Verify the gaurd makes the windows_package resource idempotent:

chef-solo -o 'recipe[ca-lab::editor]'

Step 4

From the ca-lab directory, install the Chocolatey cookbook dependency with Berkshelf, install Chocolatey, and install a chocolatey_package:

berks install
berks vendor C:\chef\repo\cookbooks\vendored
chef-solo -o 'recipe[ca-lab::browser]'

Step 5

Install IIS, configure it to host the sample website:

berks vendor C:\chef\repo\cookbooks\vendored
chef-solo -o 'recipe[ca-lab]'

Tearing Down

When finished, remove the Azure resources with:

Remove-AzureRmResourceGroup -Name cloud-kitchen -Force

chef-solo-windows's People

Contributors

lrakai avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.