ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
815 stars 1.49k forks source link

yarn module throws an error when running with --check flag #152

Closed imjoseangel closed 4 years ago

imjoseangel commented 4 years ago
SUMMARY

yarn module throws ValueError: need more than 0 values to unpack when running with --check flag.

ISSUE TYPE
COMPONENT NAME

yarn module

ANSIBLE VERSION
ansible 2.9.6
  config file = /Users/ahmed/.dotfiles/ansible.cfg
  configured module search path = ['/Users/ahmed/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.9.6_1/libexec/lib/python3.8/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.8.2 (default, Mar 11 2020, 00:29:50) [Clang 11.0.0 (clang-1100.0.33.17)]
CONFIGURATION
ANSIBLE_NOCOWS(/Users/ahmed/.dotfiles/ansible.cfg) = True
DEFAULT_GATHER_SUBSET(/Users/ahmed/.dotfiles/ansible.cfg) = ['!all']
DEFAULT_MANAGED_STR(/Users/ahmed/.dotfiles/ansible.cfg) = vim: set nomodifiable : Ansible managed - DO NOT EDIT - see template source instead ({file}) or use `:set modifiable` to force.
INTERPRETER_PYTHON(/Users/ahmed/.dotfiles/ansible.cfg) = auto_silent
RETRY_FILES_SAVE_PATH(/Users/ahmed/.dotfiles/ansible.cfg) = /Users/ahmed/.ansible
OS / ENVIRONMENT

macOS 10.15.4

STEPS TO REPRODUCE

Running the example from the documentation https://docs.ansible.com/ansible/latest/modules/yarn_module.html#examples

- name: Install "imagemin" node.js package globally.
  yarn:
    name: imagemin
    global: yes

Reported on https://github.com/ansible/ansible/issues/68827 by @ahmedelgabri

EXPECTED RESULTS

Return null out and err values

ACTUAL RESULTS

Error when running runpy on check mode

TASK [yarn : Install "imagemin" node.js package globally.] **************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ValueError: need more than 0 values to unpack
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/Users/ahmed/.ansible/tmp/ansible-tmp-1586467962.020019-255476546078701/AnsiballZ_yarn.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/Users/ahmed/.ansible/tmp/ansible-tmp-1586467962.020019-255476546078701/AnsiballZ_yarn.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/Users/ahmed/.ansible/tmp/ansible-tmp-1586467962.020019-255476546078701/AnsiballZ_yarn.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.packaging.language.yarn', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py\", line 188, in run_module\n    fname, loader, pkg_name)\n  File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py\", line 82, in _run_module_code\n    mod_name, mod_fname, mod_loader, pkg_name)\n  File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py\", line 72, in _run_code\n    exec code in run_globals\n  File \"/var/folders/x3/_cx1vn0173b5s54dhcwmrgv80000gn/T/ansible_yarn_payload_1Yqsvo/ansible_yarn_payload.zip/ansible/modules/packaging/language/yarn.py\", line 389, in <module>\n  File \"/var/folders/x3/_cx1vn0173b5s54dhcwmrgv80000gn/T/ansible_yarn_payload_1Yqsvo/ansible_yarn_payload.zip/ansible/modules/packaging/language/yarn.py\", line 362, in main\nValueError: need more than 0 values to unpack\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
imjoseangel commented 4 years ago

Fixed on https://github.com/ansible-collections/community.general/pull/153

ansibullbot commented 4 years ago

cc @chrishoffman @verkaufer click here for bot help