Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chef14 #51

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .delivery/project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml"
16 changes: 16 additions & 0 deletions .github/workflows/delivery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: delivery

on: [push, pull_request]

jobs:
delivery:

runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@master
- name: Run Chef Delivery
uses: actionshub/chef-delivery@master
env:
CHEF_LICENSE: accept-no-persist
49 changes: 41 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,49 @@
.vagrant
.kitchen
*.rbc
.config
coverage
InstalledFiles
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
_Store
*~
*#
.#*
\#*#
.*.sw[a-z]
*.un~
/cookbooks
version.txt
Berksfile.lock
*.tmp
*.bk
*.bkup

# ruby/bundler files
.ruby-version
.ruby-gemset
.rvmrc
Gemfile.lock
.bundle
*.gem

# Bundler
bin/*
.bundle/*
# YARD artifacts
.yardoc
_yardoc
doc/
.idea

# chef stuff
Berksfile.lock
.kitchen
kitchen.local.yml
vendor/
.coverage/
.zero-knife.rb
Policyfile.lock.json

# vagrant stuff
.vagrant/
.vagrant.d/
.kitchen/
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
inherit_from: .rubocop_todo.yml
60 changes: 60 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2020-04-10 13:40:46 -0500 using RuboCop version 0.55.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Max: 32

# Offense count: 2
# Configuration parameters: EnforcedStyle.
# SupportedStyles: snake_case, normalcase, non_integer
Naming/VariableNumber:
Exclude:
- 'attributes/default.rb'

# Offense count: 6
# Cop supports --auto-correct.
Style/Encoding:
Exclude:
- 'Vagrantfile'
- 'attributes/default.rb'
- 'files/default/tests/minitest/default_test.rb'
- 'libraries/matchers.rb'
- 'recipes/default.rb'
- 'resources/version.rb'

# Offense count: 2
Style/MixinUsage:
Exclude:
- 'providers/version.rb'
- 'resources/version.rb'

# Offense count: 5
# Cop supports --auto-correct.
# Configuration parameters: PreferredDelimiters.
Style/PercentLiteralDelimiters:
Exclude:
- 'rakefile.rb'
- 'spec/unit/recipes/default_spec.rb'
- 'spec/unit/recipes/regiis_spec.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInHashLiteral:
Exclude:
- 'spec/unit/recipes/default_spec.rb'
- 'spec/unit/recipes/regiis_spec.rb'

# Offense count: 30
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 116
2 changes: 0 additions & 2 deletions Berksfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
source 'https://supermarket.chef.io'

# rubocop:disable Metrics/LineLength
metadata
cookbook 'minitest-handler', git: 'https://github.com/b-dean/minitest-handler-cookbook', branch: 'chef-13-fix'
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

This file is used to list changes made in each version of dotnetframework.

## 3.0.0
- update cookbook to Chef14 custom resources
- unit and integration tests
- add kitchen testing
- add delivery framework and github integration

## 2.0.0
- ChefDK 2.5.3 rubocop and foodcritic updates
- Remove `node.set` for Chef 13 compatiblity
Expand Down
44 changes: 21 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Dotnetframework cookbook

Installs and configures the .NET framework 4, 4.5, 4.5.1, 4.5.2, or 4.6 runtime
Installs and configures the .NET framework 4 family runtime.

# Requirements
## Requirements

Tested on Windows Server 2008 R2 and Windows Server 2012R2. The selected .NET
runtime should work on versions of Windows supported by the associated .NET
Expand All @@ -12,48 +12,46 @@ installer.
* Windows 2008 R2
* Windows 2012
* Windows 2012 R2
* Windows 2016
* Windows 2019

# Usage
## Usage

Include the default recipe in your run list. The default recipe will install
the specified .NET framework version.

# Attributes
## Attributes

## default
### default

* `node['dotnetframework']['version']` - defaults to '4.5.2' Acceptable values:
'4.0', '4.5', '4.5.1', '4.5.2', '4.6', '4.6.1', '4.6.2'.
'4.0', '4.5', '4.5.1', '4.5.2', '4.6', '4.6.1', '4.6.2', '4.7', '4.7.1', '4.7.2', '4.8'

# Recipes
## Recipes

## default
### default

Installs the .NET Framework.

## regiis
### regiis

This recipe register .NET with IIS so that IIS can host .NET application
associated with the specified intalled .NET version. This recipe currently
associated with the specified installed .NET version. This recipe currently
does not support Windows 2012 or higher. For Windows 2012 or newer its
recommended that you use the IIS cookbook to register the .NET version.

## mini-tests
## Testing

You can include the mini-tests in your runlist to verify .NET was successfully
installed, however .NET will not work until you reboot.
For more details look at the [TESTING.md](./TESTING.md).

.NET 4.6 minitests will fail until you reboot, so its best to run Chef with
only dotnetframework in your runlist, reboot, then include dotnetframework
again with the minitest-handler.
## TODO

# TODO
* Install .NET using the windows_feature resource if the current OS supports it.
* Support older versions of .NET < 4.0.
* Support installation over WinRM (i.e. native scheduled task support).
* Abstract .NET installation to a Chef resource.

- Install .NET using the windows_feature resource if the current OS supports it.
- Support older versions of .NET < 4.0.
- Support installation over WinRM (i.e. native scheduled task support).
- Abstract .NET installation to a Chef resource.

# Author
## Author

Author:: Shawn Neal ([email protected])
Derek Groh ([email protected])
35 changes: 35 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# TESTING #

The [ChefDK](https://docs.chef.io/about_chefdk.html) contains all the tools required to test and develop for this cookbook. A `project.toml` file is provided so that all testing commands can be run using the `delivery local` cli that comes with ChefDK.

### Style Testing ###
Run `delivery local lint` to run cookstyle and `delivery local syntax` to run foodcritic.

### Spec Testing ###
Run `delivery local unit` to run [ChefSpec](https://github.com/chefspec/chefspec) tests.

### Combined Style + Spec Testing ###
All cookstyle, foodcritic and Chefspec tests can be run in a single command using `delivery local verify`

### Integration Testing ###
Integration testing with [Test Kitchen](https://docs.chef.io/kitchen.html) can also be done using the delivery cli. To execute all stages of testing with test kitchen you can run either `delivery local acceptance` or `kitchen test`

Test Kitchen is configured to use vagrant by default and uses [inspec](https://www.inspec.io/) to verify.

## Private Images

Some operating systems have specific licenses that prevent us from making those images available freely. We either comment these the .kitchen.yml or create a separate .kitchen.vmware.yml file for Chef internal use.

Images include:

- Windows Server 2008
- Windows Server 2012
- Windows Server 2016
- Windows Server 2019
- Windows 7 Professional
- Windows 8.1 Professional
- Mac OS X 10.7-10.12
- SLES 12 / 12SP1
- Solaris 10.11

Windows Images: https://atlas.hashicorp.com/boxes/search?order=desc&page=1&provider=virtualbox&q=windows&sort=updated&utf8=%E2%9C%93
Loading