Solvedansible windows 8.1 .net 3.5 installation: raw, win_chocolatey, win_webpicmd

ISSUE TYPE
  • Bug Report
COMPONENT NAME

raw
win_chocolatey
win_webpicmd

ANSIBLE VERSION

v2.2 from devel branch

SUMMARY

Hi! I tried to install .net 3.5 on windows with ansible and task always fails.

raw:

- name: Install .net 3.5 for windows 8
  raw: cmd /c "webpicmd /install /products:netfx3 /accepteula /suppressreboot"

output:

TASK [webdeploy : Install .net 3.5 for windows 8] ******************************
task path: /Users/ansible/roles/webdeploy/tasks/main.yml:9
<127.0.0.1> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 55986 TO 127.0.0.1
<127.0.0.1> EXEC cmd /c "webpicmd /install /products:netfx3 /accepteula /suppressreboot"
fatal: [win-8.1_TFS_IIS]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"_raw_params": "cmd /c \"webpicmd /install /products:netfx3 /accepteula /suppressreboot\""}, "module_name": "raw"}, "rc": 1, "stderr": "", "stdout": "\r    \r\r\n\r    \rThe software that you obtain using the Web Platform Installer Command Line Tool is licensed to you by its owner.  Microsoft grants you no rights for third party software.\r\n\r .  \r .. \r    \rSuccessfully loaded primary feed: https://go.microsoft.com/?linkid=9842185\r\n\r    \rThe following software is going to be installed:\r\n\r    \rEULA: '.NET 3.5 for Windows 8', which is owned by 'Microsoft' will be installed\r\n\r    \rThe license agreement to '.NET 3.5 for Windows 8' may be included with the software. \r\nYou are responsible for and must separately locate, read and accept these license terms.\r\n\r    \rAccepted EULA.\r\n\r    \rStarting Installation\r\n\r    \rStarted installing Products... \r\n\r    \rStarted installing: '.NET 3.5 for Windows 8'\r\n\r .  \r .. \r ...\r    \r .  \r    \rInstall completed (Failure): '.NET 3.5 for Windows 8'\r\n\r    \rNetFx3 : Failed.\r\n\r\n\r    \r\r\n\r    \rVerifying successful installation...\r\n\r    \r.NET 3.5 for Windows 8                             False\r\n\r    \rInstall of Products: FAILURE\r\n\r    \r", "stdout_lines": ["", "    ", "", "", "    ", "The software that you obtain using the Web Platform Installer Command Line Tool is licensed to you by its owner.  Microsoft grants you no rights for third party software.", "", " .  ", " .. ", "    ", "Successfully loaded primary feed: https://go.microsoft.com/?linkid=9842185", "", "    ", "The following software is going to be installed:", "", "    ", "EULA: '.NET 3.5 for Windows 8', which is owned by 'Microsoft' will be installed", "", "    ", "The license agreement to '.NET 3.5 for Windows 8' may be included with the software. ", "You are responsible for and must separately locate, read and accept these license terms.", "", "    ", "Accepted EULA.", "", "    ", "Starting Installation", "", "    ", "Started installing Products... ", "", "    ", "Started installing: '.NET 3.5 for Windows 8'", "", " .  ", " .. ", " ...", "    ", " .  ", "    ", "Install completed (Failure): '.NET 3.5 for Windows 8'", "", "    ", "NetFx3 : Failed.", "", "", "    ", "", "", "    ", "Verifying successful installation...", "", "    ", ".NET 3.5 for Windows 8                             False", "", "    ", "Install of Products: FAILURE", "", "    "]}

win_webpicmd:

- name: Install .net 3.5 for windows 8
  win_webpicmd: name=NetFx3

output:

TASK [webdeploy : Install .net 3.5 for windows 8] ******************************
task path: /Users/ansible/roles/webdeploy/tasks/main.yml:14
<127.0.0.1> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 55986 TO 127.0.0.1
<127.0.0.1> EXEC Set-StrictMode -Version Latest
(New-Item -Type Directory -Path $env:temp -Name "ansible-tmp-1455013167.41-229969870230844").FullName | Write-Host -Separator '';
<127.0.0.1> PUT "/var/folders/pn/4kz8l_gj17b68231lwxygjy80000gn/T/tmplgBPl_" TO "C:\Users\vagrant\AppData\Local\Temp\ansible-tmp-1455013167.41-229969870230844\win_webpicmd.ps1"
<127.0.0.1> EXEC Set-StrictMode -Version Latest
Try
{
& "C:\Users\vagrant\AppData\Local\Temp\ansible-tmp-1455013167.41-229969870230844\win_webpicmd.ps1"
}
Catch
{
$_obj = @{ failed = $true }
If ($_.Exception.GetType)
{
$_obj.Add('msg', $_.Exception.Message)
}
Else
{
$_obj.Add('msg', $_.ToString())
}
If ($_.InvocationInfo.PositionMessage)
{
$_obj.Add('exception', $_.InvocationInfo.PositionMessage)
}
ElseIf ($_.ScriptStackTrace)
{
$_obj.Add('exception', $_.ScriptStackTrace)
}
Try
{
$_obj.Add('error_record', ($_ | ConvertTo-Json | ConvertFrom-Json))
}
Catch
{
}
Echo $_obj | ConvertTo-Json -Compress -Depth 99
Exit 1
}
Finally { Remove-Item "C:\Users\vagrant\AppData\Local\Temp\ansible-tmp-1455013167.41-229969870230844" -Force -Recurse -ErrorAction SilentlyContinue }
fatal: [win-8.1_TFS_IIS]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "win_webpicmd"}, "msg": "Error installing NetFx3", "webpicmd_error_cmd": "WebpiCmd.exe /install /products:NetFx3 /accepteula /suppressreboot", "webpicmd_error_log": "             The software that you obtain using the Web Platform Installer Command Line Tool is licensed to you by its owner.  Microsoft grants you no rights for third party software.   .    ..       Successfully loaded primary feed: https://go.microsoft.com/?linkid=9842185       The following software is going to be installed:       EULA: '.NET 3.5 for Windows 8', which is owned by 'Microsoft' will be installed       The license agreement to '.NET 3.5 for Windows 8' may be included with the software.  You are responsible for and must separately locate, read and accept these license terms.       Accepted EULA.       Starting Installation       Started installing Products...        Started installing: '.NET 3.5 for Windows 8'   .    ..   ...       .    ..   ...       .    ..       Install completed (Failure): '.NET 3.5 for Windows 8'       NetFx3 : Failed.               Verifying successful installation...       .NET 3.5 for Windows 8                             False       Install of Products: FAILURE      "}

win_chocolatey:

- name: Install .net 3.5 for windows 8
  win_chocolatey: 
    name: dotnet3.5

output:

TASK [webdeploy : Install .net 3.5 for windows 8] ******************************
task path: /Users/ansible/roles/webdeploy/tasks/main.yml:14
<127.0.0.1> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 55986 TO 127.0.0.1
<127.0.0.1> EXEC Set-StrictMode -Version Latest
(New-Item -Type Directory -Path $env:temp -Name "ansible-tmp-1455013351.05-280945857911420").FullName | Write-Host -Separator '';
<127.0.0.1> PUT "/var/folders/pn/4kz8l_gj17b68231lwxygjy80000gn/T/tmpL435IJ" TO "C:\Users\vagrant\AppData\Local\Temp\ansible-tmp-1455013351.05-280945857911420\win_chocolatey.ps1"
<127.0.0.1> EXEC Set-StrictMode -Version Latest
Try
{
& "C:\Users\vagrant\AppData\Local\Temp\ansible-tmp-1455013351.05-280945857911420\win_chocolatey.ps1"
}
Catch
{
$_obj = @{ failed = $true }
If ($_.Exception.GetType)
{
$_obj.Add('msg', $_.Exception.Message)
}
Else
{
$_obj.Add('msg', $_.ToString())
}
If ($_.InvocationInfo.PositionMessage)
{
$_obj.Add('exception', $_.InvocationInfo.PositionMessage)
}
ElseIf ($_.ScriptStackTrace)
{
$_obj.Add('exception', $_.ScriptStackTrace)
}
Try
{
$_obj.Add('error_record', ($_ | ConvertTo-Json | ConvertFrom-Json))
}
Catch
{
}
Echo $_obj | ConvertTo-Json -Compress -Depth 99
Exit 1
}
Finally { Remove-Item "C:\Users\vagrant\AppData\Local\Temp\ansible-tmp-1455013351.05-280945857911420" -Force -Recurse -ErrorAction SilentlyContinue }
fatal: [win-8.1_TFS_IIS]: FAILED! => {"changed": false, "choco_error_cmd": "choco.exe install -dv -y dotnet3.5", "choco_error_log": "Chocolatey is running on Windows v 6.3.9600.0 Attempting to delete file \"C:/ProgramData/Chocolatey/choco.exe.old\". Attempting to delete file \"C:\\ProgramData\\Chocolatey\\choco.exe.old\". Command line: \"C:\\ProgramData\\Chocolatey\\choco.exe\" install -dv -y dotnet3.5 Received arguments: install -dv -y dotnet3.5  NOTE: Hiding sensitive configuration data! Please double and triple   check to be sure no sensitive data is shown, especially if copying   output to a gist for review. Configuration: CommandName='install'| CacheLocation='C:\\Users\\vagrant\\AppData\\Local\\Temp'| ContainsLegacyPackageInstalls='True'| CommandExecutionTimeoutSeconds='2700'| Sources='https://chocolatey.org/api/v2/'|Debug='True'|Verbose='True'| Force='False'|Noop='False'|HelpRequested='False'|RegularOutput='True'| QuietOutput='False'|PromptForConfirmation='False'|AcceptLicense='True'| AllowUnofficialBuild='False'|Input='dotnet3.5'|AllVersions='False'| SkipPackageInstallProvider='False'|PackageNames='dotnet3.5'| Prerelease='False'|ForceX86='False'|OverrideArguments='False'| NotSilent='False'|IgnoreDependencies='False'| AllowMultipleVersions='False'|AllowDowngrade='False'| ForceDependencies='False'|Information.PlatformType='Windows'| Information.PlatformVersion='6.3.9600.0'| Information.PlatformName='Windows 8.1'| Information.ChocolateyVersion='0.9.9.11'| Information.ChocolateyProductVersion='0.9.9.11'| Information.FullName='choco, Version=0.9.9.11, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|  Information.Is64Bit='True'|Information.IsInteractive='False'| Information.IsUserAdministrator='True'| Information.IsProcessElevated='True'|Features.AutoUninstaller='False'| Features.CheckSumFiles='True'|Features.FailOnAutoUninstaller='False'| ListCommand.LocalOnly='False'| ListCommand.IncludeRegistryPrograms='False'| UpgradeCommand.FailOnUnfound='False'| UpgradeCommand.FailOnNotInstalled='False'| UpgradeCommand.NotifyOnlyAvailableUpgrades='False'| NewCommand.AutomaticPackage='False'|SourceCommand.Command='unknown'| SourceCommand.Priority='0'|FeatureCommand.Command='unknown'| ConfigCommand.Command='unknown'|PushCommand.TimeoutInSeconds='0'| PinCommand.Command='unknown'| _ Chocolatey:ChocolateyInstallCommand - Normal Run Mode _ Installing the following packages: dotnet3.5 By installing you accept licenses for the packages. [NuGet] Installing 'DotNet3.5 3.5.20160116'. [NuGet] Added file 'dotnet.png' to folder 'DotNet3.5'. [NuGet] Added file 'ChocolateyInstall.ps1' to folder 'DotNet3.5\\Tools'. [NuGet] Added file 'DotNet3.5.nupkg' to folder 'DotNet3.5'. [NuGet] Successfully installed 'DotNet3.5 3.5.20160116'.  DotNet3.5 v3.5.20160116 Contents of 'C:\\ProgramData\\chocolatey\\lib\\DotNet3.5\\Tools\\ChocolateyInstall.ps1': if(-not (test-path \"hklm:\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v3.5\")) {   $packageArgs = \"/c DISM /Online /NoRestart /Enable-Feature /FeatureName:NetFx3 /All\"   $statements = \"cmd.exe $packageArgs\"   Start-ChocolateyProcessAsAdmin \"$statements\" -minimized -nosleep -validExitCodes @(0) } else {      Write-Host \"Microsoft .Net 3.5 Framework is already installed on your machine.\"  }   Calling command ['\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" -NoProfile -NoLogo -ExecutionPolicy Bypass -Command \"[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\\ProgramData\\chocolatey\\helpers\\chocolateyInstaller.psm1'; & 'C:\\ProgramData\\chocolatey\\helpers\\chocolateyScriptRunner.ps1' -packageScript 'C:\\ProgramData\\chocolatey\\lib\\DotNet3.5\\Tools\\ChocolateyInstall.ps1' -installArguments '' -packageParameters ''\"']  DEBUG: Posh version is 4.0  DEBUG: Loading community extensions  VERBOSE: Exporting function 'Get-BinRoot'.  VERBOSE: Exporting function 'Get-ChecksumValid'.  VERBOSE: Exporting function 'Get-ChocolateyUnzip'.  VERBOSE: Exporting function 'Get-ChocolateyWebFile'.  VERBOSE: Exporting function 'Get-EnvironmentVariable'.  VERBOSE: Exporting function 'Get-EnvironmentVariableNames'.  VERBOSE: Exporting function 'Get-FtpFile'.  VERBOSE: Exporting function 'Get-ProcessorBits'.  VERBOSE: Exporting function 'Get-UACEnabled'.  VERBOSE: Exporting function 'Get-VirusCheckValid'.  VERBOSE: Exporting function 'Get-WebFile'.  VERBOSE: Exporting function 'Get-WebHeaders'.  VERBOSE: Exporting function 'Install-BinFile'.  VERBOSE: Exporting function 'Install-ChocolateyDesktopLink'.  VERBOSE: Exporting function 'Install-ChocolateyEnvironmentVariable'.  VERBOSE: Exporting function 'Install-ChocolateyExplorerMenuItem'.  VERBOSE: Exporting function 'Install-ChocolateyFileAssociation'.  VERBOSE: Exporting function 'Install-ChocolateyInstallPackage'.  VERBOSE: Exporting function 'Install-ChocolateyPackage'.  VERBOSE: Exporting function 'Install-ChocolateyPath'.  VERBOSE: Exporting function 'Install-ChocolateyPinnedTaskBarItem'.  VERBOSE: Exporting function 'Install-ChocolateyPowershellCommand'.  VERBOSE: Exporting function 'Install-ChocolateyShortcut'.  VERBOSE: Exporting function 'Install-ChocolateyVsixPackage'.  VERBOSE: Exporting function 'Install-Vsix'.  VERBOSE: Exporting function 'Install-ChocolateyZipPackage'.  VERBOSE: Exporting function 'Set-EnvironmentVariable'.  VERBOSE: Exporting function 'Start-ChocolateyProcessAsAdmin'.  VERBOSE: Exporting function 'Test-ProcessAdminRights'.  VERBOSE: Exporting function 'Uninstall-BinFile'.  VERBOSE: Exporting function 'Uninstall-ChocolateyPackage'.  VERBOSE: Exporting function 'UnInstall-ChocolateyZipPackage'.  VERBOSE: Exporting function 'Update-SessionEnvironment'.  VERBOSE: Exporting function 'Write-ChocolateyFailure'.  VERBOSE: Exporting function 'Write-ChocolateySuccess'.  VERBOSE: Exporting function 'Write-FileUpdateLog'.  VERBOSE: Exporting alias 'Generate-BinFile'.  VERBOSE: Exporting alias 'Add-BinFile'.  VERBOSE: Exporting alias 'Remove-BinFile'.  DEBUG: Running 'Start-ChocolateyProcessAsAdmin' with exeToRun:'powershell',   statements: 'cmd.exe /c DISM /Online /NoRestart /Enable-Feature   /FeatureName:NetFx3 /All'   DEBUG: Elevating Permissions and running powershell block:        $noSleep = $True        & import-module -name    'C:\\ProgramData\\chocolatey\\helpers\\chocolateyInstaller.psm1';         try{          $progressPreference=\"SilentlyContinue\"          cmd.exe /c DISM /Online /NoRestart /Enable-Feature /FeatureName:NetFx3   /All           if(!$noSleep){start-sleep 6}        }        catch{          if(!$noSleep){start-sleep 8}          throw        }   This may take a while, depending on the statements.  Deployment Image Servicing and Management tool  Version: 6.3.9600.17031  Image Version: 6.3.9600.17031  Enabling feature(s)  Error: 0x800f0906  The source files could not be downloaded.   Use the \"source\" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077.  The DISM log file can be found at C:\\Windows\\Logs\\DISM\\dism.log  [ERROR] Running C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe with   cmd.exe /c DISM /Online /NoRestart /Enable-Feature /FeatureName:NetFx3 /All   was not successful. Exit code was '1' Error Message: Posh version is 4.0  Loading community extensions  Exporting function 'Get-BinRoot'.  Exporting function 'Get-ChecksumValid'.  Exporting function 'Get-ChocolateyUnzip'.  Exporting function 'Get-ChocolateyWebFile'. Command ['\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" -NoProfile -NoLogo -ExecutionPolicy Bypass -Command \"[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\\ProgramData\\chocolatey\\helpers\\chocolateyInstaller.psm1'; & 'C:\\ProgramData\\chocolatey\\helpers\\chocolateyScriptRunner.ps1' -packageScript 'C:\\ProgramData\\chocolatey\\lib\\DotNet3.5\\Tools\\ChocolateyInstall.ps1' -installArguments '' -packageParameters ''\"'] exited with '1'  Exporting function 'Get-EnvironmentVariable'. Calling command ['\"shutdown\" /a']  Exporting function 'Get-EnvironmentVariableNames'.  Exporting function 'Get-FtpFile'.  Exporting function 'Get-ProcessorBits'.  Exporting function 'Get-UACEnabled'.  Exporting function 'Get-VirusCheckValid'.  Exporting function 'Get-WebFile'.  Exporting function 'Get-WebHeaders'. Command ['\"shutdown\" /a'] exited with '1116'  Exporting function 'Install-BinFile'.  Exporting function 'Install-ChocolateyDesktopLink'.  Exporting function 'Install-ChocolateyEnvironmentVariable'.  Exporting function 'Install-ChocolateyExplorerMenuItem'.  Exporting function 'Install-ChocolateyFileAssociation'.  Exporting function 'Install-ChocolateyInstallPackage'. Capturing package files in 'C:\\ProgramData\\chocolatey\\lib\\DotNet3.5'  Exporting function 'Install-ChocolateyPackage'.  Found 'C:\\ProgramData\\chocolatey\\lib\\DotNet3.5\\dotnet.png'   with checksum '0D5A15B93F47DF7F91B24A14C7CE91FE'  Exporting function 'Install-ChocolateyPath'.  Exporting function 'Install-ChocolateyPinnedTaskBarItem'.  Found 'C:\\ProgramData\\chocolatey\\lib\\DotNet3.5\\DotNet3.5.nupkg'   with checksum 'F3968F896990DA36207FBD83F1F83865'  Exporting function 'Install-ChocolateyPowershellCommand'.  Found 'C:\\ProgramData\\chocolatey\\lib\\DotNet3.5\\Tools\\ChocolateyInstall.ps1'   with checksum '2BC68B73F2AAA7A33F450CF0FA40F71D'  Exporting function 'Install-ChocolateyShortcut'.  Exporting function 'Install-ChocolateyVsixPackage'.  Exporting function 'Install-Vsix'.  Exporting function 'Install-ChocolateyZipPackage'. Attempting to delete file \"C:\\ProgramData\\chocolatey\\.chocolatey\\DotNet3.5.3.5.20160116\\.files.update\".  Exporting function 'Set-EnvironmentVariable'. Attempting to delete file \"C:\\ProgramData\\chocolatey\\.chocolatey\\DotNet3.5.3.5.20160116\\.sxs\".  Exporting function 'Start-ChocolateyProcessAsAdmin'.  Exporting function 'Test-ProcessAdminRights'. Attempting to delete file \"C:\\ProgramData\\chocolatey\\.chocolatey\\DotNet3.5.3.5.20160116\\.pin\". Attempting to delete directory \"C:\\ProgramData\\chocolatey\\lib-bad\\DotNet3.5\".  Exporting function 'Uninstall-BinFile'. The install of dotnet3.5 was NOT successful.  Exporting function 'Uninstall-ChocolateyPackage'.  Exporting function 'UnInstall-ChocolateyZipPackage'. Error while running 'C:\\ProgramData\\chocolatey\\lib\\DotNet3.5\\Tools\\ChocolateyInstall.ps1'.  See log for details. Moving 'C:\\ProgramData\\chocolatey\\lib\\DotNet3.5'  to 'C:\\ProgramData\\chocolatey\\lib-bad\\DotNet3.5'  Exporting function 'Update-SessionEnvironment'.  Exporting function 'Write-ChocolateyFailure'.  Exporting function 'Write-ChocolateySuccess'.  Exporting function 'Write-FileUpdateLog'.  Exporting alias 'Generate-BinFile'.  Exporting alias 'Add-BinFile'.  Exporting alias 'Remove-BinFile'.  .  At C:\\ProgramData\\chocolatey\\helpers\\functions\\Start-ChocolateyProcessAsAdmin.p  s1:92 char:5  +     throw $errorMessage  +     ~~~~~~~~~~~~~~~~~~~      + CategoryInfo          : OperationStopped: ([ERROR] Running...ve-BinFile'      .  .:String) [], RuntimeException      + FullyQualifiedErrorId : [ERROR] Running C:\\Windows\\System32\\WindowsPower      Shell\\v1.0\\powershell.exe with cmd.exe /c DISM /Online /NoRestart /Enable-      Feature /FeatureName:NetFx3 /All was not successful. Exit code was '1' Err      or Message: Posh version is 4.0  Loading community extensions  Exporting function 'Get-BinRoot'.  Exporting function 'Get-ChecksumValid'.  Exporting function 'Get-ChocolateyUnzip'.  Exporting function 'Get-ChocolateyWebFile'.  Exporting function 'Get-EnvironmentVariable'.  Exporting function 'Get-EnvironmentVariableNames'.  Exporting function 'Get-FtpFile'.  Exporting function 'Get-ProcessorBits'.  Exporting function 'Get-UACEnabled'.  Exporting function 'Get-VirusCheckValid'.  Exporting function 'Get-WebFile'.  Exporting function 'Get-WebHeaders'.  Exporting function 'Install-BinFile'.  Exporting function 'Install-ChocolateyDesktopLink'.  Exporting function 'Install-ChocolateyEnvironmentVariable'.  Exporting function 'Install-ChocolateyExplorerMenuItem'.  Exporting function 'Install-ChocolateyFileAssociation'.  Exporting function 'Install-ChocolateyInstallPackage'.  Exporting function 'Install-ChocolateyPackage'.  Exporting function 'Install-ChocolateyPath'.  Exporting function 'Install-ChocolateyPinnedTaskBarItem'.  Exporting function 'Install-ChocolateyPowershellCommand'.  Exporting function 'Install-ChocolateyShortcut'.  Exporting function 'Install-ChocolateyVsixPackage'.  Exporting function 'Install-Vsix'.  Exporting function 'Install-ChocolateyZipPackage'.  Exporting function 'Set-EnvironmentVariable'.  Exporting function 'Start-ChocolateyProcessAsAdmin'.  Exporting function 'Test-ProcessAdminRights'.  Exporting function 'Uninstall-BinFile'.  Exporting function 'Uninstall-ChocolateyPackage'.  Exporting function 'UnInstall-ChocolateyZipPackage'.  Exporting function 'Update-SessionEnvironment'.  Exporting function 'Write-ChocolateyFailure'.  Exporting function 'Write-ChocolateySuccess'.  Exporting function 'Write-FileUpdateLog'.  Exporting alias 'Generate-BinFile'.  Exporting alias 'Add-BinFile'.  Exporting alias 'Remove-BinFile'.  .  Chocolatey installed 0/1 package(s). 1 package(s) failed.  See the log for details (C:\\ProgramData\\chocolatey\\logs\\chocolatey.log). Failures:  - dotnet3.5 Exiting with 1", "failed": true, "invocation": {"module_name": "win_chocolatey"}, "msg": "Error installing dotnet3.5"}

Executing command in cmd was successful with webpicmd:

C:\Users\vagrant>webpicmd /install /products:netfx3 /accepteula /suppressreboot

The software that you obtain using the Web Platform Installer Command Line Tool
is licensed to you by its owner.  Microsoft grants you no rights for third party
 software.
Successfully loaded primary feed: https://go.microsoft.com/?linkid=9842185
The following software is going to be installed:
EULA: '.NET 3.5 for Windows 8', which is owned by 'Microsoft' will be installed
The license agreement to '.NET 3.5 for Windows 8' may be included with the softw
are.
You are responsible for and must separately locate, read and accept these licens
e terms.
Accepted EULA.
Starting Installation
Started installing Products...
Started installing: '.NET 3.5 for Windows 8'
Install completed (Success): '.NET 3.5 for Windows 8'
.NET 3.5 for Windows 8 : Installed

Verifying successful installation...
.NET 3.5 for Windows 8                             True
Install of Products: SUCCESS

and choco:

C:\Users\vagrant>choco install dotnet3.5 -y
Installing the following packages:
dotnet3.5
By installing you accept licenses for the packages.

DotNet3.5 v3.5.20160116
 Deployment Image Servicing and Management tool
 Version: 6.3.9600.17031
 Image Version: 6.3.9600.17031
 Enabling feature(s)
 The operation completed successfully.
 The install of dotnet3.5 was successful.

Chocolatey installed 1/1 package(s). 0 package(s) failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

What is the problem and how to install .net 3.5?
It would be better to do it through webpicmd as the installation 'IIS7' package depends on the .net 3.5.

17 Answers

✔️Accepted Answer

I ran into this on Server 2012. The easiest solution I found was this:

- name: Install .NET Framework 3.5
  raw: 'Install-WindowsFeature Net-Framework-Core'

Per this MSDN page.
Edited for cleanliness :)

Related Issues:

143
ansible module_stdout: "/bin/sh: 1: /usr/bin/python: not found\r\n",
Just use ansible_python_interpreter=/usr/bin/python3 in ur inventory file ansible -m ping -u ubuntu ...
88
ansible error in cryptography setup command: Invalid environment marker: python_version < '3'
I had the same problem in Debian Jessie This is what I did to get it working for me: After this I wa...
88
ansible OSX crash complaining of operation in progress in another thread when fork() was called
This is apparently due to some new security changes made in High Sierra that are breaking lots of Py...
72
ansible Failed to connect to the host via ssh: Permission denied (publickey,password)
Good It's a bit hard to debug when you specify all in your command I have this error I use Debian St...
71
ansible Describe how to use "postgresql_user" properly with ansible >= 2.1.0.0
I managed to get this temporarily working with pipelining per task and becoming postgres user: Hopef...
54
ansible ansible unable to find boto: boto required for this module
@stevenscg still working me with this in my inventory file: Let me know if that does anything for yo...
43
ansible why is ansible's default output not more human readable... stilll?
Ansible 2.4+ has built-in support for human-readable results: Temporarily by setting ANSIBLE_STDOUT_...
37
ansible Reboot and Wait for
An update of the docs and/or the support article to use the preferred full YAML format for tasks wou...
37
ansible ERROR! Timeout (12s) waiting for privilege escalation prompt:
Just as a note I switched the connection over to paramiko and the issue went away and the playbook r...
33
ansible Failed to import docker-py for docker_container module
docker-py is just the name of the project It installs a python package named docker ...
32
ansible json_query filter fails when using the functions "contains", "starts_with", others
The problem is related to the fact that Ansible uses own types for strings: AnsibleUnicode and Ansib...
31
ansible feature: controlling ignore-errors output
From a UX perspective it seems reasonable to give visual distinction between explicitly ignored erro...
30
ansible Support specifying collections in git repositories in requirements.yml
This has become much more frustrating lately SUMMARY When I develop collections I like to store them...
29
ansible SSH works, but ansible throws unreachable error
This happende all of a sudden when I upgraded Ansible ISSUE TYPE Bug Report ANSIBLE VERSION CONFIGUR...
29
ansible Ansible evaluates with_items for tasks in blocks skipped by the block when condition
For anyone who finds this in future the way to have this work without the warning is to use with_ite...
29
ansible "template error while templating string: Missing end of comment tag" error
EDIT: When unsafe characters are defined in vars follow @inossidabile's recommendation to use !unsaf...
24
ansible ansible-galaxy should download dependencies in meta/main.yml
I heavily work with dependencies and meta/main.yml and it would be great to spare the necessity to m...
24
ansible Add an option lock_wait to the apt module
This should integrate with systemd ISSUE TYPE Feature Idea This is a copy of the issue on the old re...
23
ansible Windows 10/WSL: Ansible cannot read ansible.cfg from NTFS mounts
I think I found a solution for 2.6.1 and so on.. SUMMARY Ansible 2.6.1 added #42070 which makes Ansi...
20
ansible Anisble does not allow handling of "host unreachable" errors
Does anyone else agree we need to revisit how we are handling unreachable errors? We have a use case...
20
ansible delegate_to not propagated to include_role
I would say this is a huge issue If Ansible would have raised an error for combination of delegate_t...
18
ansible shared connection closed
Same for me on macOS: ISSUE TYPE Bug Report COMPONENT NAME Script module ANSIBLE VERSION CONFIGURATI...
16
ansible Handle omit value in task attributes (like environment or become_user)
I too am interested in something similar to this In my use case we use the same playbook for multipl...
15
ansible FAILED! => {"msg": "Timeout (12s) waiting for privilege escalation prompt: "}
This happened to me after my internet connect dropped while running a playbook I fixed it by running...
14
ansible apt_key module ignores the proxy environment
I'm using this as a workaround: ISSUE TYPE Bug Report COMPONENT NAME apt_key ANSIBLE VERSION SUMMARY...
13
ansible Failure in apt. "Please install python-apt", but it is installed
I ran into this issue using the local connection mode -c local using ansible from a virtualenv ...
12
ansible [mac os x] ansible-galaxy: "unexpected Exception: name must be a byte string" when installing from requirements file
Upgrading urllib3 solved this problem for me: sudo pip install --upgrade urllib3 ...
12
ansible Support apt-mark hold
Full working example for reference from Ubuntu 16.04 and docker: From @scottnonnenberg on September ...
12
ansible Single Vault Encrypted value not decrypted in jinja2 pipeline
It still not work for password_hash It need to add string before using password_hash ...
12
ansible file touch always 'changed' - [was: need a separate touch module]
FYI: In Ansible 2.7 was added access_time and modification_time so you can use that to avoid change ...
12
ansible podman support (podman_container)
I am working on the following modules for inclusion in TripleO: podman_image podman_container I also...
11
ansible Inventory script does not work with assumed roles from the command line
For me the fix was to set AWS_SECURITY_TOKEN to the same value as AWS_SESSION_TOKEN ...
11
ansible failed to transfer file to ~/.ansible/tmp/ansible-tmp-xxx/setup.py: [Errno 2] No such file or directory
Same issue here with 2.2.1 (ok with 2.2.0) ISSUE TYPE Bug Report COMPONENT NAME ansible-playbook set...
11
ansible mysql_user broken in 2.7.1 when using /root/.my.cnf
Ok I found it It was a discussion on #ansible-devel on October 2nd SUMMARY When upgrading from 2.7.0...
8
ansible k8s module throwing 'This module requires the OpenShift Python client. Try pip install openshift'
So in my case it was an annoying Requests-related exception (actually just a RequestsDependencyWarni...
6
ansible synchronize: rsync_opts broken/changed in ansible 2.3.0
rsync cmd: BAD (ansible 2.3.0) GOOD (ansible 2.2.2.0) ISSUE TYPE Bug Report COMPONENT NAME synchroni...
5
ansible Issues in template module
Maybe you can add -K option for ansible-playbook command I fixed this problem in my case. ...
4
ansible (P1) nxos* modules timeout sending long running command for transport == cli
@mikewiebe One possible way is: provider: {{ connection | combine({'timeout': 400}) }} ...
3
ansible windows 8.1 .net 3.5 installation: raw, win_chocolatey, win_webpicmd
I ran into this on Server 2012 The easiest solution I found was this: Per this MSDN page Edited for ...
3
ansible pywinrm fails to authenticate from centos 7 host to windows 2012 R2 client
Had the same issue Fixed by uninstalling pyOpenSSL completely (cleaning folders like @darioems sugge...
3
ansible HaProxy drain mode 'bool' object is not callable error
@alikins I looked into the issue today ISSUE TYPE Bug Report COMPONENT NAME HaProxy Module ANSIBLE V...
3
ansible Add possibility to set up several ips for hostname in module ipa_dnsrecord
Are you thinking a format something like: ISSUE TYPE Feature Idea COMPONENT NAME ipa_dnsrecord ANSIB...
82
drupal vm Composer install fails without proper swap
or you can create a swap file sudo fallocate -l 2G /swapfile sudo chmod 600 /swapfile sudo mkswap /s...
77
kubespray After the certificate expires how use kubespray to renew certificate
@kerOssinas you are right the upgrade-cluster.yml of Kubespray will also rotate the certificates ...
32
kubespray Current install documentation is incorrect and does not work due to inventory script changes
@elfiii good luck. The install/usage documentation here: https://github.com/kubernetes-sigs/kubespra...
31
ansible elasticsearch Permissions on elasticsearch.keystore prevent Elasticsearch from starting
This entire problem is being caused by an incorrect mixing of static read-only configuration (elasti...
29
drupal vm Failing to install Drupal on macOS High Sierra - NFS filesystem issues
@ajhoddinott OMG That works thank you! For explicit instructions on Mac OS High Sierra open the app ...
28
kubespray etcd cluster is unavailable or misconfigured: connection refused
Run on master nodes: Run no all nodes: btw SELinux is working fine i did not had to do any adjustmen...
22
kubespray Unable to add new master/etcd node to cluster
You should be able to In the past we managed to replace all nodes in the cluster: master etcd and wo...
21
ansible lint Re-evaluate E0010 - Package installs should not use latest
The official Ansible yum module docs prominently recommend using state=latest with name=* to update ...