Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
504 views
in Technique[技术] by (71.8m points)

Ansible win_package gets stuck forever when installing PowerShell 7 MSI

I'm trying to install the PowerShell7-MSI-package via Ansible. During execution it seems that Ansible is stuck (at least for about 45 minutes ...). For the installation I'm using the win_package module. I also found this SO question which unfortunately has no answer.

The host I'm trying to install to is:

OS Name:                   Microsoft Windows 10 Enterprise
OS Version:                10.0.19042 N/A Build 19042

Ansible version:

ansible 2.9.16
  config file = /etc/ansible/ansible.cfg
  executable location = /usr/bin/ansible
  python version = 3.6.8 (default, Aug 24 2020, 17:57:11) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]

Playbook:

---
# tasks file for common

- name: Create temp directory
  win_file:
    path: "{{ ansibleRemoteTemp }}"
    state: directory
- name: Copy Powershell package
  win_copy:
    src: ../files/PowerShell-7.1.0-win-x64.msi
    dest: "{{ ansibleRemoteTemp }}/PowerShell-7.1.0-win-x64.msi"
- name: Install PowerShell 7
  win_package:
    product_id: '{8B34F593-C5DF-47D9-AD0E-23D579F6D83E}'
    path: "{{ ansibleRemoteTemp }}/PowerShell-7.1.0-win-x64.msi"
    state: present
    arguments: ' /package PowerShell-7.1.0-win-x64.msi /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1'

The arguments are based on this docs.microsoft.com link.

Here is my Ansible output:

...

TASK [common : Copy Powershell package] *************************************************************************************************************************************************************************
ok: [server_14] => {
    "changed": false,
    "checksum": "517a93072f1f3d2d82b4634a506a84a808f63de2",
    "dest": "C:/Users/ansibletestuser/AppData/Local/Temp/playbookPackages/PowerShell-7.1.0-win-x64.msi",
    "operation": "file_copy",
    "original_basename": "PowerShell-7.1.0-win-x64.msi",
    "size": 99663872,
    "src": "../files/PowerShell-7.1.0-win-x64.msi"
}

TASK [common : Install PowerShell 7] ****************************************************************************************************************************************************************************

HERE WE ARE STUCK

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...