Skip to content

Playing with Chef to deploy Chocolatey to nodes with the git package added

License

Notifications You must be signed in to change notification settings

syehab/chef-azure-test

 
 

Repository files navigation

win_choco

About This Cookbook

This cookbook was put together to test installing Chocolatey on Windows systems. It utilizes the Chocolatey install cookbook from the Chef Supermarket. This was also created to show examples of multiple ways to guard application installation using attributes.

Kitchen Testing

We are using the Policyfile model and integrated the kitchen verify Inspec tests into a Compliance Profile as a part of the cookbook (client 17). Notice that the test\integration\default test in the kitchen.yml file was updated to point to the same content. But interestingly, it happens on the client side as well at the end of the run. I have noticed that you might have to run a kitchen converge twice.

Notice the Attributes section in the kitchen.yml file as well. There are examples of how to include attributes (as if they were node attributes on the Chef Server) as well as tags. This is how you would replicate those Chef Server Node Attributes.

If you add and then remove attributes in the kitchen.yml file, you will need to remove the .json file on the guest (test vm) located in c:\Users\vagrant\AppData\Local\kitchen\node\ and then next run all of the attributes will be regathered. This is moderately an anti-pattern to Kitchen testing, but if you want to test what happens when an application is added or removed - triggered by an attribute / tag, that is the only way.

Requirements

Platforms

  • Windows 10, 11
  • Windows server 2012, 2016. 2019

Chef

  • Chef server 17+

Dependent Cookbooks

The following cookbooks are required to include this cookbook.

  • Chocolatey

Issues

Issues and suggestions are welcome. Win Choco on Github

License & Authors

Authors: Michael Butler (@snohio)

License: 2022, Apache 2 - by Snohio

Thanks for Watching

Feel free to give this a clone down and see how it does on your system. Drop on some issues if you have questions or enhancement suggestions.

About

Playing with Chef to deploy Chocolatey to nodes with the git package added

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%