cookbook 'ms_dotnet', '= 4.0.1'
ms_dotnet
(27) Versions
4.0.1
-
Follow31
Installs/Configures ms_dotnet
cookbook 'ms_dotnet', '= 4.0.1', :supermarket
knife supermarket install ms_dotnet
knife supermarket download ms_dotnet
ms_dotnet Cookbook
Install the Microsoft .NET Framework.
Requirements
This cookbook supports and requires Chef 12.1+ to take advantage of the reboot
and windows_package
built-in resources.
Platforms
- Windows XP
- Windows Vista
- Windows Server 2003 R2
- Windows 7
- Windows Server 2008 (R1, R2)
- Windows 8 and 8.1
- Windows Server 2012 (R1, R2)
- Windows Server 2016
Cookbooks
The following cookbook is required as noted:
-
[windows](windows_cookbook) (>= 2.1.0)
ms_dotnet_framework
LWRP leverage thewindows_feature
LWRP
MSDotNet::PackageHelper
class used inms_dotnet_framework
leverages the::Windows::VersionHelper
module.
Known Issues
Here are the known issues you can encounter with ms_dotnet recipes:
* "Access denied" error on windows_package when running chef via WinRM
* Cause
: winrm limitation
* Common environment
: knife windows bootstrap, chef-provisioning, test-kitchen
* Theoretical solution
: try to simulate a local session by wrapping your chef-client call in psexec or a schedule task.
* Test-Kitchen solution
: with v1.8.0 you can use the winrm-elevated feature that'll run chef via a schedule task
Usage
This cookbook provides you two methods to install the major versions of .NET framework.
Common case - Recipes
In common cases you can use the attributes driven recipes provided by this cookbook to setup .NET.
Custom case - LWRP
In more custom cases, you might need to control in your own cookbook which .NET version should be installed and when the setup should be performed.
You just need to use the ms_dotnet_framework
LWRP which handles for you the setup mode - feature vs package - and may also install all known patches.
Resource/Provider
ms_dotnet_framework
Actions
-
:install
- Install a specific .NET framework
Attribute Parameters
-
version
- Name attribute. Specify the .NET version to install. -
include_patches
- Determine whether patches should also be applied (default:true
) -
feature_source
- Specify custom source for windows features. Only avaiable on NT Version 6.2 (Windows 8/2012) or newer. (default:nil
) -
perform_reboot
- Determine whether chef should perform required reboot after installing new packages or feature. (default:false
) -
package_sources
- Specify custom sources URL for windows packages. URL are indexed by their content SHA256 checkum. (default:{}
) -
require_support
- Determine whether chef should fail when given version is not supported on the current OS (default:false
)
NB:
feature_source
works only on NT Version 6.2 (Windows 8/2012) or newer.
Examples
Install .NET 4.5.2 from custom sources
ms_dotnet_framework '4.5.2' do action :install include_patches true perform_reboot true package_sources('6c2c589132e830a185c5f40f82042bee3022e721a216680bd9b3995ba86f3781' => 'http://my-own.site.com/NetFx452.exe') require_support true end
Attributes
This cookbook is mostly attributes driven, default values should be enough for common cases.
NB: because this cookbook is usefull only for windows, attributes are not available on other platforms
Common attributes
Below attributes are accessible via node['ms_dotnet']['ATTRIBUTE_NAME']
and are common to all recipes:
* timeout
- Control the execution timeout in seconds of .NET setup packages (default: 600
)
.NET recipes attributes
Recipes ms_dotnet2
, ms_dotnet3
and ms_dotnet4
are controlled by the following attributes accessible via node['ms_dotnet']['vX']['ATTRIBUTE_NAME']
- where X
is the .NET major version:
-
version
- Specify the .NET version to install (default:2.0.SP2
,3.5.SP1
,4.0
) -
include_patches
- Determine whether patches should also be applied (default:true
) -
feature_source
- Specify custom source for windows features. Only avaiable on NT Version 6.2 (Windows 8/2012) or newer. (default:nil
) -
perform_reboot
- Determine whether chef should perform required reboot after installing new packages or feature. (default:false
) -
package_sources
- Specify custom sources URL for windows packages. URL are indexed by their content SHA256 checkum. (default:{}
) -
require_support
- Determine whether chef should fail when given version is not supported on the current OS (default:false
)
NB:
feature_source
works only on NT Version 6.2 (Windows 8/2012) or newer.
Examples
Install .NET 3.5 SP1 using a Windows UNC Share
Custom node file to install .NET 3.5 SP1 with no patch on a Windows Server 2012R2, using a Windows share for features binaries:
json
{
"name": "my-node.examples.com",
"run_list": [ "recipe[ms_dotnet::ms_dotnet3" ],
"normal": {
"ms_dotnet": {
"v3": {
"include_patches": "false",
"feature_source": "\\ShareSvr\sxs"
}
}
}
}
Install .NET 4.5.2 using a package hosted on a custom site
Custom node file to install .NET 4.5.2 from a custom site:
json
{
"name": "my-node.examples.com",
"run_list": [ "recipe[ms_dotnet::ms_dotnet4" ],
"normal": {
"ms_dotnet": {
"v4": {
"version": "4.5.2",
"package_sources": {
"6c2c589132e830a185c5f40f82042bee3022e721a216680bd9b3995ba86f3781": "http://my-own.site.com/NetFx452.exe"
}
}
}
}
}
Recipes
ms_dotnet::default
This recipe does nothing.
ms_dotnet::ms_dotnet2, ms_dotnet::ms_dotnet3, ms_dotnet::ms_dotnet4
Each of these recipes allow you to install a specific major version of .NET Framework, just by including the recipe in your node run_list
.
They are attribute driven recipes, please referes to the Attributes
section of this README to know how to control their behavior.
ms_dotnet::regiis
This recipe register .NET 4 to IIS once and only if IIS service exist.
Libraries
Default
Provides convenients method for the ms_dotnet
cookbook.
version_helper
Provides a factory to get specific VersionHelper instance.
PackageHelper
References all official .NET setup & patches packages supported by this cookbook.
packages
Retrieve a Hash containing .NET setup packages info - name
, checksum
, url
& not_if
guard.
A string not_if
guard represents a custom command to determine whether the package should be installed.
A string Array not_if
guard represents the list of QFE representing or superseding the package.
core?
Determine whether the current node is running on a Core version of Windows.
server?
Determine whether the current node is running on a Server version of Windows.
x64?
Determine whether the architecture of the current node is 64-bits.
VersionHelper
Base abstract class inheriting from PackageHelper
and providing convenient methods to determine which .NET version the current node supports, and how the setup should be handled.
features
Get windows features required by the given .NET version
installed_version
Get installed .NET version on the current node
package
Get windows package required by the given .NET version
patches
Get windows patches required by the given .NET version
prerequisites
Get windows packages required before installing the given .NET version
supported_versions
Get all .NET versions supported on the current node OS
V2Helper, V3Helper, V4Helper
Subclass of the VersionHelper
, providing helpers for a specific major version of the .NET Framework.
Contributing
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
License and Authors
Authors: Baptiste Courtois (b.courtois@criteo.com), Jeremy Mauro (j.mauro@criteo.com)
Copyright 2014-2017, Criteo. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
ms_dotnet CHANGELOG
This file is used to list changes made in each version of the ms_dotnet cookbook.
4.0.1
- PR 75 Fix prerequisites for .NET 4.7 (thanks nadobando)
4.0.0
Improvments
- Fix .NET 4.6.2 on Windows Server 2008R2 & Server 2012 (thanks Taliesin Sisson)
- Properly supports .NET 4 for Windows 10 & Windows Server 2016
- Add support for .NET 4.7
- Leverage version helpers from windows cookbook
- Reboot only for .NET packages (thanks Jakauppila)
- Remove some Chef 13 deprecation warnings
- Enhanced patches & prerequisites system
Breaking changes
- Requires Chef >= 12.6 for proper custom resource definition
- Requires Windows cookbook >= 2.1.0 for Windows version's helpers
3.2.1
- PR 53 olive42 - Fix install requirement check
- PR 49 jugatsu - Improve ms_dotnet_framework example in README
- PR 46 olivierlemasle - Install KB2919442 before KB2919355 for .NET 4.6
- PR 44 smurawski - Fix version detection when none installed 3.2.0 -----
- PR 43 smurawski - Migrate framework LWRP to custom resource
3.1.1
- PR 38 Jakauppila - Update .NET 4.6 prerequisites (KB3173424)
3.1.0
- b.courtois - Support Windows Server 2016.
- PR 35 b.courtois - Add ability to perform required reboot when installing prerequisites and patches.
- PR 34 b.courtois - Fix patches feature due to invalid prerequisites variable.
- PR 31 Matasx - Add support for .NET version 4.6.2.
-
PR 31 Matasx - Resolve
0x80240017 WU_E_NOT_APPLICABLE
issue with KB2919442.
3.0.0
Improvments
- Introduce new framework LWRP to setup a specific .NET Version with all its prerequisites and patches.
- Detection of the current installed version is now way more accurate.
- Setup of .NET 3.5 is working properly.
- Proper support of .NET 4.6 and .NET 4.6.1.
- Packages and sources overriding is attribute driven.
- Attribute structure is now the same for .NET 2, 3.5 and 4.
- Add chefspecs and rspecs tests.
Breaking changes
Default recipes and attributes structure have been updated to use the new LWRP.
Refers to the README for description and examples of the new attributes.
2.6.1
- kamaradclimber - Define Windows::VersionHelper::ProductType constants only once
2.6.0
- b.courtois - Use version helper everywhere to remove references to Win32::Version
- b.courtois - Add new helper to retrieve windows version info from ohai
- b.courtois - Use NetFx3ServerFeatures instead of NetFx3 for .NET3.5
2.5.1
- b.courtois - Trust windows_feature behavior in recipe ms_dotnet3
2.5.0
- b.courtois - Supports custom source for .Net 3.5 install
- b.courtois - Use travis container-based infrastructure
- b.courtois - Use travis bundler caching
- b.courtois - Don't test agains ruby 1.9.3 anymore
2.4.0
- Y.Siu - Support .Net3.5 on Windows 8.1 and Server 2012R2.
2.3.0
- b.courtois - Register aspnet to iis once and only if ISS is present.
2.2.1
- minkaotic - Fix .NET 3.5 install guard clause.
2.2.0
- b.courtois - Do not use the windows_reboot resource and its request action.
2.1.1
- b.courtois - Update constraint to leverage windows cookbook >=1.36.1
2.1.0
- b.courtois - Fix .NET4.5 support on windows 7/Server 2008R2
2.0.0
- b.courtois - Fail chef run when an invalid .NET4 version is specified
- b.courtois - Better support of recents windows version for .NET4
- b.courtois - Add ms_dotnet3 recipe
- b.courtois - Fix ms_dotnet2 recipe and stop to use ms_dotnet2 attributes
1.2.0
- b.courtois - Fail chef run when an invalid .NET4 version is specified
1.1.0
- b.courtois - Fix attributes computation
1.0.0
- b.courtois - Merge recipes ms_dotnet4 and ms_dotnet45
- b.courtois - Add basic support for Server 2012 & 2012R2
0.2.0
- b.courtois - include default recipe on msdotnet2 core install
0.1.0
- j.mauro - Initial release of ms_dotnet
Collaborator Number Metric
4.0.1 passed this metric
Contributing File Metric
4.0.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
4.0.1 passed this metric
License Metric
4.0.1 passed this metric
No Binaries Metric
4.0.1 passed this metric
Testing File Metric
4.0.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
4.0.1 passed this metric
4.0.1 passed this metric
4.0.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
4.0.1 passed this metric
License Metric
4.0.1 passed this metric
No Binaries Metric
4.0.1 passed this metric
Testing File Metric
4.0.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
4.0.1 passed this metric
4.0.1 passed this metric
4.0.1 passed this metric
No Binaries Metric
4.0.1 passed this metric
Testing File Metric
4.0.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
4.0.1 passed this metric
4.0.1 passed this metric
4.0.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
4.0.1 passed this metric
4.0.1 passed this metric