Skip to content

Instantly share code, notes, and snippets.

@big-samantha
Created April 14, 2016 22:21
Show Gist options
  • Select an option

  • Save big-samantha/06f50d191358353f21e575d0e77cf761 to your computer and use it in GitHub Desktop.

Select an option

Save big-samantha/06f50d191358353f21e575d0e77cf761 to your computer and use it in GitHub Desktop.
class dotnet::install_v4
(
$url = hiera(repo_windows),
$user = hiera('win_repo_user'),
$pwd = hiera('win_repo_passwd'),
$sub_url = hiera('dotnet_url'),
$dotnet_v = hiera('dotnet_version'),
$source_dir = hiera('dotnet_install_dir'),
$dotnet40_logs = hiera('dotnet40_log'),
)
{
if $file_exists == "false" {
case $kernelmajversion {
6.1: {
$packagename = hiera('dotnet40_packagename')
}
}
exec { "wget dotNetFx4":
command => "wget.exe -N --user=$user --password=$pwd $url/$sub_url/$packagename -P /temp",
path => ["c:/temp", "C:/Windows/System32"],
logoutput => on_failure,
}
package { 'Microsoft .NET Framework Extended':
ensure => '$dotnet_v',
source => "$source_dir\\$packagename",
install_options => ['/q','/norestart'],
require => Exec["wget dotNetFx4"],
}
package { 'Microsoft .NET Framework Client Profile':
ensure => '$dotnet_v',
source => "$source_dir\\$packagename",
install_options => ['/q','/norestart'],
require => Package['Microsoft .NET Framework Extended'],
}
file { "$dotnet40_logs":
ensure => file,
content => "Microsoft .NET Framework Extended and Microsoft .NET Framework Client Profile have been installed.\n",
require => Package['Microsoft .NET Framework Client Profile' ],
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment