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

creates_path not a working parameter for programs not already installed program #169

Closed
36roentgen opened this issue Jan 11, 2021 · 1 comment · Fixed by #174
Closed

Comments

@36roentgen
Copy link

36roentgen commented Jan 11, 2021

SUMMARY

win_package doesn't handle the presence of creates_path and creates_version for hosts where the package is not already installed.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

win_package

ANSIBLE VERSION
ansible 2.10.4
  config file = None
  configured module search path = ['/home/auser/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/auser/ansible-certs/lib64/python3.6/site-packages/ansible
  executable location = /home/auser/ansible-certs/bin/ansible
  python version = 3.6.8 (default, Sep 26 2019, 11:57:09) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
CONFIGURATION

OS / ENVIRONMENT

Target OS is Windows server 2012 R2

STEPS TO REPRODUCE

Pre-populate download location.
Run this task

    - name: Install git
      win_package:
        path: '{{ downloads }}\Git-2.30.0-32-bit.exe'
        creates_path: C:\Program Files (x86)\Git\bin\git.exe
        creates_version: 2.30.0.1
        state: present
        arguments: /VERYSILENT /LOADINF="{{ downloads }}"\gitinstaller.inf /SUPPRESSMSGBOXES /RESTARTAPPLICATIONS"
EXPECTED RESULTS

If the file path and version doesn't exist, run the executable at path with arguments. <-DOESN'T WORK
If the file path and version do exist, exit task successfully. <-WORKS

ACTUAL RESULTS
TASK [Install git] ***************************************************************************************************************************************************************************************************************************
task path: /usr/home/auser/ansible_windows_certs/windows_certs_pb.yaml:86
redirecting (type: modules) ansible.builtin.win_package to ansible.windows.win_package
Using module file /home/auser/ansible-certs/lib64/python3.6/site-packages/ansible_collections/ansible/windows/plugins/modules/win_package.ps1
Pipelining is enabled.
<my.2012windows.server.example> ESTABLISH WINRM CONNECTION FOR USER: WinAdminUser on PORT 5986 TO my.2012windows.server.example
EXEC (via pipeline wrapper)
The full traceback is:
creates_path must be a file not a directory when creates_version is set
At line:599 char:17
+                 throw "creates_path must be a file not a directory when creates_ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (creates_path mu..._version is set:String) [], RuntimeException
    + FullyQualifiedErrorId : creates_path must be a file not a directory when creates_version is set

ScriptStackTrace:
at Get-InstalledStatus, <No file>: line 599
at <ScriptBlock>, <No file>: line 1361
fatal: [my.2012windows.server.example]: FAILED! => {
    "changed": false,
    "msg": "Unhandled exception while executing module: creates_path must be a file not a directory when creates_version is set"
}
@36roentgen 36roentgen changed the title creates_path not a working parameter for programs not already installed creates_path not a working parameter for programs not already installed program Jan 11, 2021
@jborean93
Copy link
Collaborator

Thanks @36roentgen for the bug report, I believe #174 should fix this problem for you.

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

Successfully merging a pull request may close this issue.

2 participants