jimbo8098 / windows-docker-role

An Ansible Role to Install Docker on Windows
https://galaxy.ansible.com/jimbo8098/windows-docker-role
0 stars 3 forks source link

Play exits with error: commands are already available on this system #1

Open dry4ng opened 3 years ago

dry4ng commented 3 years ago

As I'm trying to run this role against freshly provisioned Google cloud image of Windows Server 2019 Core, it exits with the following error:

TASK [jimbo8098.windows_docker_role : Ensure PowerShellGet is installed] *********************************************
fatal: [myhostname]: FAILED! => {"changed": false, "msg": "Problems adding a prerequisite module PowerShellGet The following commands are already available on this system:'Find-Package,Install-Package,Uninstall-Package'. This module 'PackageManagement' may override the existing commands. If you still want to install this module 'PackageManagement', use -AllowClobber parameter.", "nuget_changed": false, "output": "", "repository_changed": false}

vars:

reboots_allowed: true
docker:
  version: 18.03

Ansible 2.10.6 Windows Server 2019 1909 DC Core

jimbo8098 commented 3 years ago

There's a check in this task to make sure a minimum version of PowerShellGet is installed here:

https://github.com/jimbo8098/windows-docker-role/blob/10770bbb5ea32377ad55955b8535034be0fc12a5/tasks/main.yml#L41-L44

I bet that one of these isn't the case:

These are requirements from https://docs.ansible.com/ansible/latest/collections/community/windows/win_psmodule_module.html

Can you check which of those requirements you meet/don't meet above? If I remember rightly, you can use Get-Module, Get-PackageProvider and Get-Host to get this information.

Let me know what you find and I'll try and help you from there.