Unable to install dot net framework 4.5.2 using win_feature

Hi

I am facing two issues:

  1. I am trying to install Dot Net framework 4.5.2 using win_feature:
  • win_feature:
    name: DotNet-4-5-2
    state: present

I am getting below error message:

fatal: [13.90.93.211]: FAILED! => {
“changed”: false,
“failed”: true,
“msg”: “The process C:\ProgramData\Microsoft\Windows\PowerShell\Configuration\BuiltinProvCache\MSFT_PackageResource\confirmation.aspx could not be started”,
“name”: “https://www.microsoft.com/en-us/download/confirmation.aspx?id=42643
}

  1. I am trying to install Advanced Logging for IIS using below code. Only partial file is getting downloaded and it doesnt show any error response. Is there any other way for installing Advanced Logging?

Can someone help me with these issues?

Hi,

I’ve not had that error you encountered when installing .net 4.5.2 using win_feature.

Is .net 4.5.2 already in the running windows image?

You can probably tell by running Get-WindowsFeature on the machine where you want to install. If it isn’t already present in windows I imagine it will fail.

If its an older windows version before server 2012 there is a standalone installer for .net 4.5. In fact ansible includes a script which will install it on older windows machines that don’t yet have powershell 3.0. Its mentioned here in the documentation. http://docs.ansible.com/ansible/intro_windows.html#getting-to-powershell-3-0-or-higher

So you can probably workaround it by either using the script mentioned above or tweaking it to just install .net 4.5.2.

Regarding your second problem, I think the issue is that win_get_url is not following the confirmation redirect. You can probably workaround that by finding the static download location, which you can do by using Ctrl-Shift-I or F12 to open developer tools in your web browser, then go through a manual download of the .msi and watch the network traffic - you will see the actual location the file downloads from after you click on the download link.

Personally I’d recommend capturing all the things you want to install to somewhere where you control and then serving up any .msi files or whatever via your own web server. Yes its an extra step and more complexity to manage, but it means when you run your playbooks you aren’t dependent on having remote web servers running.

Hope this helps,

Jon