*ISSUE TYPE*
 - Bug Report

*COMPONENT NAME*
Win_shell

*ANSIBLE VERSION*

ansible 2.3.0.0
config file = /home/<my-user>/ansible-docker/ansible.cfg (just disabled 
host key checking)
configured module search path = Default w/o overrides
 python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 
20160609]



##### CONFIGURATION

host_key_checking = False


*OS / ENVIRONMENT*
Control Machine: Ubuntu 16.04 machine
Guest Machine: Windows Server 2016

*SUMMARY*
Could not install Docker for Windows using the same commands indicated on 
docker interactive installation on docker 
website(https://docs.docker.com/engine/installation/windows/docker-ee/). 

*STEPS TO REPRODUCE*

Windows Server 2016, clean installation with Powershell Remoting and WinRM 
service enabled with basic authentication and allow unencrypted for WinRM 
service.


- hosts: windows
  tasks:
    - name: Enable Windows Container Feature
      win_feature:
        name: Containers
        state: present
    - name: Install Nuget Package Provider
      win_shell: Install-PackageProvider -Name "NuGet" -MinimumVersion 
"2.8.5.201" -Force
    - name: Install Docker Msft Module
      win_shell: Install-Module -Name "DockerMsftProvider" -Repository 
"PSGallery" -Force
    - name: Install Docker package #error in this task
      win_shell: Install-Package –ProviderName "DockerMsftProvider" -Name 
"Docker" -Force
    - name: Start docker service   #Start-Service docker
      win_service:
        name: docker
        state: started
        start_mode: auto




*EXPECTED RESULTS*
Docker installed and running 

*ACTUAL RESULTS*
Package manager returns an error (see stacktrace below, refered to task for 
installation of Docker package)

TASK [Install Docker package] 
****************************************************************************************************************************************************************************
task path: /home/carlo/ansible-docker-trystack/windows_hosts.yml:11         
                                                                            
                                                  
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/windows/
win_shell.ps1                                                               
                                                   
<192.168.87.129> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 
5985 TO 192.168.87.129                                                     
                                                   
EXEC (via pipeline wrapper)                                                 
                                                                            
                                                  
fatal: [192.168.87.129]: FAILED! => {                                       
                                                                            
                                                  
    "changed": true,                                                       
                                                                            
                                                   
    "cmd": "Install-Package –ProviderName \"DockerMsftProvider\" -Name 
\"Docker\" -Force",                                                         
                                                       
    "delta": "0:00:07.845040",                                             
                                                                            
                                                   
    "end": "2017-07-17 02:53:56.827786",                                   
                                                                            
                                                   
    "failed": true,                                                         
                                                                            
                                                  
    "rc": 1,                                                               
                                                                            
                                                   
    "start": "2017-07-17 02:53:48.982746",                                 
                                                                            
                                                   
    "stderr": "Install-Package : No match was found for the specified 
search criteria and package name 'Docker'. Try \r\nGet-PackageSource to see 
all available registered package sources.\r\nAt line:1 c
har:65\r\n+ ... ing $false; Install-Package –ProviderName 
\"DockerMsftProvider\" -Name  ...\r\n+                 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + 
CategoryInfo          
: ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) 
[Install-Package], Ex \r\n   ception\r\n    + FullyQualifiedErrorId : 
NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.
Cmdlets.InstallPackage",                                                   
                                                                            
                                                   
    "stderr_lines": [                                                       
                                                                            
                                                  
        "Install-Package : No match was found for the specified search 
criteria and package name 'Docker'. Try ",                                 
                                                        
        "Get-PackageSource to see all available registered package sources."
,                                                                           
                                                  
        "At line:1 char:65",                                               
                                                                            
                                                   
        "+ ... ing $false; Install-Package –ProviderName 
\"DockerMsftProvider\" -Name  ...",                                         
                                                                     
        "+                 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",                 
                                                                            
                       
        "    + CategoryInfo          : ObjectNotFound: 
(Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Ex ", 
                                                                       
        "   ception",                                                       
                                                                            
                                                  
        "    + FullyQualifiedErrorId : 
NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage"
 
                                                                            
    ],                                                                     
                                                                            
                                                   
    "stdout": "",                                                           
                                                                            
                                                  
    "stdout_lines": []                                                     
                                                                            
                                                   
}                                                                           
                                                                            
                                                  
        to retry, use: --limit @/home/carlo/ansible-docker-trystack/
windows_hosts.retry         

                                                                            
                              


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/aa66a1e8-2883-4ea8-a4f1-6acd5e602fe9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to