Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.

win_chcolatey fails when successfull #990

Closed
lionbee opened this issue Sep 17, 2015 · 5 comments
Closed

win_chcolatey fails when successfull #990

lionbee opened this issue Sep 17, 2015 · 5 comments

Comments

@lionbee
Copy link

lionbee commented Sep 17, 2015

I'm using Ansible version 1.9.3

This command fails even though it is successful

- name: Install Microsoft Build Tools
  win_chocolatey:
    name: microsoft-build-tools -y
    upgrade: True

This is the error message:

failed: [xxx.xxx.xxx.xxx] => {"changed": false, "chocolatey command": "choco.exe install microsoft-build-tools -y -source https://chocolatey.org/api/v2/", "failed": true}
msg: Install error: Chocolatey v0.9.9.8 Installing the following packages: microsoft-build-tools By installing you accept licenses for the packages. microsoft-build-tools v12.0.21005.20140416 Downloading microsoft-build-tools 32 bit from 'http://download.microsoft.com/download/9/B/B/9BB1309E-1A8F-4A47-A6C5-ECF76672A3B3/BuildTools_Full.exe' Installing microsoft-build-tools... microsoft-build-tools has been installed. The install of microsoft-build-tools was successful. Chocolatey installed 1/1 package(s). 0 package(s) failed. See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

The problem stems from the fact that success is defined by string parsing instead of return code. Is there a reason return code is not used? I can understand that you will want to use string parsing to decide whether an install happened or whether the package was already present, but it seems you only want to raise an error if return code != 0

@robynbergeron
Copy link
Contributor

[module: windows/win_chocolatey.py]

@robynbergeron
Copy link
Contributor

Hi @thirty3 -- thanks for submitting this bug report.

@trondhindenes @petemounce @elventear @smadam813 -- pinging you to let you know about this bug report for win_chocolatey.

@tolbertam
Copy link

It appears that win_chocolatey has been refactored in 2.0 (#398) and it now checks status code as you suggest. I dropped the version from the devel branch into stable1.9 locally and it looks it works completely as a drop in replacement. I think it would be very nice if it got merged back to 1.9 otherwise this module will not work with newer versions of chocolatey. Is there any reason why that couldn't be pulled in? I would be a happy and willing tester! 👍

@bcoca
Copy link
Member

bcoca commented Feb 20, 2016

closing this issue via #398

@tolbertam I'm not sure it will be backported nor if it makes sense unless we make more 1.9 releases

@bcoca bcoca closed this as completed Feb 20, 2016
@tolbertam
Copy link

@bcoca after playing around with ansible & windows a bit, it seems like ansible 2.0 is the right choice for me anyways, 👍

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

No branches or pull requests

4 participants