GithubHelp home page GithubHelp logo

win_package - Installing MSI Succeeds, But ConnectionError Thrown Before Program is Listed in Control Panel about ansible.windows HOT 1 CLOSED

ansible-collections avatar ansible-collections commented on July 17, 2024
win_package - Installing MSI Succeeds, But ConnectionError Thrown Before Program is Listed in Control Panel

from ansible.windows.

Comments (1)

jborean93 avatar jborean93 commented on July 17, 2024

There's nothing we can do here, the Windows Admin Center install is bouncing the WinRM service which stops the the win_package module from reporting back it's status, in reality it actually kills the win_package module because it's a child process of the WinRM process. The docs for Install Windows Admin Center even state

Installing Windows Admin Center will restart the WinRM service, which will sever all remote PowerShells sessions

It does go onto to you can add the parameter/argument RESTART_WINRM=0 to stop that behaviour and manually bounce that service another way for Windows Admin Center to function. What you should do is reboot after a change was detected like so

- name: Install WAC
  win_package:
    path: C:\Users\Administrator\Downloads\WindowsAdminCenter1910.2.msi
    state: present
    arguments: >-
      SME_PORT=443
      SSL_CERTIFICATE_OPTION=generate
      RESTART_WINRM=0
  register: wac_install

# WAC needs to restart the WinRM service, only sane way of handling that in Ansible that uses WinRM is to use win_reboot to reboot the host
- name: Reboot after installing WAC
  win_reboot:
  when: wac_install is changed

I also changed the arguments from using a list to a string as the list conversion doesn't work too well for MSI packages. If reboot a host isn't viable for you then you could try and restart the WinRM service through async in a separate task. Unfortunately it won't be as stable as doing a reboot as that win_reboot action plugin handles things like the host not being reachable which is hard to do in a separate task.

from ansible.windows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.