Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-AnsibleWindowsWebRequestSpec CommandNotFoundException on msi package installation with ansible.windows.win_package #138

Closed
Nimrod-666 opened this issue Nov 26, 2020 · 3 comments

Comments

@Nimrod-666
Copy link

SUMMARY

Hi, i'm trying to install a msi package with ansible.windows.win_package and getting an error:

My task:

- name: Install check-mk-agent
  ansible.windows.win_package:
    path: C:\check-mk-agent-1.5.0p25-7b000db4d120c53d.msi
    state: present

The error:

TASK [basicsystem_checkmk_agent : Install check-mk-agent] ***********************************************************************************************************************************************************************************
task path: /home/SCHEER/a500112/workspace/ansible/Playbooks/roles/basicsystem_checkmk_agent/tasks/Windows.yml:10
Using module file /home/SCHEER/a500112/.ansible/collections/ansible_collections/ansible/windows/plugins/modules/win_package.ps1
Pipelining is enabled.
<10.175.244.50> ESTABLISH WINRM CONNECTION FOR USER: ansibleusr on PORT 5986 TO 10.175.244.50
EXEC (via pipeline wrapper)
The full traceback is:
The term 'Get-AnsibleWindowsWebRequestSpec' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1295 char:65
+ ... bleModule]::Create($args, $spec, @(Get-AnsibleWindowsWebRequestSpec))
+                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-AnsibleWindowsWebRequestSpec:String) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : CommandNotFoundException

ScriptStackTrace:
at <ScriptBlock>, <No file>: line 1295
fatal: [10.175.244.50]: FAILED! => {
    "changed": false,
    "msg": "Unhandled exception while executing module: The term 'Get-AnsibleWindowsWebRequestSpec' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."
}
ISSUE TYPE
  • Bug Report
COMPONENT NAME

ansible.windows.win_package

ANSIBLE VERSION
ansible 2.9.15
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.17 (default, Sep 30 2020, 13:38:04) [GCC 7.5.0]

CONFIGURATION
DEFAULT_VAULT_PASSWORD_FILE(/etc/ansible/ansible.cfg) = /scheer/.vault_pass.txt
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
OS / ENVIRONMENT

Server: Ubuntu 18.04
Target: Windows Server 2019

STEPS TO REPRODUCE
- name: Install check-mk-agent
  ansible.windows.win_package:
    path: C:\check-mk-agent-1.5.0p25-7b000db4d120c53d.msi
    state: present
EXPECTED RESULTS

I would expect that the msi agent would be installed

ACTUAL RESULTS

Exception thrown

@jborean93
Copy link
Collaborator

This collection has a requirement of Ansible 2.10 or newer https://github.com/ansible-collections/ansible.windows/blob/main/meta/runtime.yml#L1ecause this isn't compatible due to this reason. Some things do work on 2.9 but others don't hence why we have the minimum version.

There's nothing we can do about this and this error is expected if you are on 2.9.x.

@piotrplenik
Copy link

This is not bad answer since Ansible 2.10 is not available on RHEL and Centros.
Info:
https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-on-rhel-centos-or-fedora

As a results this task is not works on AWX/Ansible Tower too (it's use Centos 8).

@jborean93
Copy link
Collaborator

Regardless of the type of the answer the result is still the same. You need to use the version of this module included with Ansible 2.9. If you want to use this collection you need Ansible 2.10+, there’s nothing I can do to change that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants