Giter Club home page Giter Club logo

Comments (5)

excalq avatar excalq commented on July 4, 2024 1

Possibly related to ansible-collections/community.general#4708 (comment)?

from ansible-collection-mac.

excalq avatar excalq commented on July 4, 2024

Getting the same fatal error, when running mac-dev-playbook, on a completely fresh MacBook M1 running Sonoma 14.3.1. The same error repeats for each homebrew_cask_apps in config.yml. Unclear how to workaround or proceed.

Error Reported

TASK [geerlingguy.mac.homebrew : Install configured cask applications.] **********************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: '<' not supported between instances of 'str' and 'int'
failed: [127.0.0.1] (item=docker) => changed=false 
  ansible_loop_var: item
  item: docker
  module_stderr: |-
    Traceback (most recent call last):
      File "/Users/arthur/.ansible/tmp/ansible-tmp-1708469930.622443-5587-245938492723656/AnsiballZ_homebrew_cask.py", line 107, in <module>
        _ansiballz_main()
      File "/Users/arthur/.ansible/tmp/ansible-tmp-1708469930.622443-5587-245938492723656/AnsiballZ_homebrew_cask.py", line 99, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/Users/arthur/.ansible/tmp/ansible-tmp-1708469930.622443-5587-245938492723656/AnsiballZ_homebrew_cask.py", line 47, in invoke_module
        runpy.run_module(mod_name='ansible_collections.community.general.plugins.modules.homebrew_cask', init_globals=dict(_module_fqn='ansible_collections.community.general.plugins.modules.homebrew_cask', _modlib_path=modlib_path),
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/runpy.py", line 210, in run_module
        return _run_module_code(code, init_globals, run_name, mod_spec)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/runpy.py", line 97, in _run_module_code
        _run_code(code, mod_globals, init_globals,
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "/var/folders/9n/wgtj2qt1631bw_sywp_w0x3w0000gp/T/ansible_homebrew_cask_payload_w75x72lg/ansible_homebrew_cask_payload.zip/ansible_collections/community/general/plugins/modules/homebrew_cask.py", line 895, in <module>
      File "/var/folders/9n/wgtj2qt1631bw_sywp_w0x3w0000gp/T/ansible_homebrew_cask_payload_w75x72lg/ansible_homebrew_cask_payload.zip/ansible_collections/community/general/plugins/modules/homebrew_cask.py", line 887, in main
      File "/var/folders/9n/wgtj2qt1631bw_sywp_w0x3w0000gp/T/ansible_homebrew_cask_payload_w75x72lg/ansible_homebrew_cask_payload.zip/ansible_collections/community/general/plugins/modules/homebrew_cask.py", line 450, in run
      File "/var/folders/9n/wgtj2qt1631bw_sywp_w0x3w0000gp/T/ansible_homebrew_cask_payload_w75x72lg/ansible_homebrew_cask_payload.zip/ansible_collections/community/general/plugins/modules/homebrew_cask.py", line 523, in _run
      File "/var/folders/9n/wgtj2qt1631bw_sywp_w0x3w0000gp/T/ansible_homebrew_cask_payload_w75x72lg/ansible_homebrew_cask_payload.zip/ansible_collections/community/general/plugins/modules/homebrew_cask.py", line 671, in _install_casks
      File "/var/folders/9n/wgtj2qt1631bw_sywp_w0x3w0000gp/T/ansible_homebrew_cask_payload_w75x72lg/ansible_homebrew_cask_payload.zip/ansible_collections/community/general/plugins/modules/homebrew_cask.py", line 622, in _install_current_cask
      File "/var/folders/9n/wgtj2qt1631bw_sywp_w0x3w0000gp/T/ansible_homebrew_cask_payload_w75x72lg/ansible_homebrew_cask_payload.zip/ansible_collections/community/general/plugins/modules/homebrew_cask.py", line 485, in _current_cask_is_installed
      File "/var/folders/9n/wgtj2qt1631bw_sywp_w0x3w0000gp/T/ansible_homebrew_cask_payload_w75x72lg/ansible_homebrew_cask_payload.zip/ansible_collections/community/general/plugins/modules/homebrew_cask.py", line 513, in _brew_cask_command_is_deprecated
      File "/var/folders/9n/wgtj2qt1631bw_sywp_w0x3w0000gp/T/ansible_homebrew_cask_payload_w75x72lg/ansible_homebrew_cask_payload.zip/ansible/module_utils/compat/version.py", line 78, in __ge__
      File "/var/folders/9n/wgtj2qt1631bw_sywp_w0x3w0000gp/T/ansible_homebrew_cask_payload_w75x72lg/ansible_homebrew_cask_payload.zip/ansible/module_utils/compat/version.py", line 338, in _cmp
    TypeError: '<' not supported between instances of 'str' and 'int'
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1

Code Location

Grepping for the task description leads me to line 141 in the collection role:

    - name: Install configured cask applications.
      homebrew_cask:
        name: "{{ item.name | default(item) }}"
        state: present
        install_options: "{{ item.install_options | default('appdir=' + homebrew_cask_appdir) }}"
        accept_external_apps: "{{ homebrew_cask_accept_external_apps }}"
        sudo_password: "{{ ansible_become_password | default(omit) }}"
      loop: "{{ homebrew_cask_apps }}"
      notify:
        - Clear homebrew cache

from ansible-collection-mac.

mark-omarov avatar mark-omarov commented on July 4, 2024

Giving it a look on the go. It does look like underlying issue with the community.general version compatibility check rather than this collection. I'll take another look by the end of the week and potentially close this issue in favor of mentioned by @excalq.

from ansible-collection-mac.

excalq avatar excalq commented on July 4, 2024

Having given up, and manually running brew install visual-studio-code caused Homebrew to also update itself, which fixed the root cause. Previously brew version reported Homebrew >=4.1.0 (shallow or no git repository). Now it reports Homebrew 4.2.9.

So I suppose issuing a brew update --auto-update before using Cask for the first time would help prevent this issue on a new MacOS install.

from ansible-collection-mac.

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.