ansible-role-zsh icon indicating copy to clipboard operation
ansible-role-zsh copied to clipboard

Version comparison: '<' not supported between instances of 'str' and 'int'

Open numediaweb opened this issue 2 years ago • 1 comments

With latest updates of Vagrant, I get this error regarding this line on tasks/configure.yml:

TASK [zsh : Check commands exists] *********************************************
[DEPRECATION WARNING]: Using tests as filters is deprecated. Instead of using
`result|version` use `result is version`. This feature will be removed in
version 2.9. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
fatal: [default]: FAILED! => {"msg": "An unhandled exception occurred while templating 
'[{'name': 'command-not-found', 'when': \"{{ ansible_os_family != 'Darwin' }}\"}, {'name': 'brew', 'command': 'brew'}, 
{'name': 'docker', 'command': 'docker'}, {'name': 'docker-compose', 'command': 'docker-compose'}, 'fancy-ctrl-z', 
'git-extras', 'gnu-utils', {'name': 'httpie', 'command': 'http'}, {'name': 'go', 'command': 'go'}, 
{'name': 'gulp', 'command': 'gulp'}, {'name': 'pip', 'command': 'pip'}, {'name': 'rake', 'command': 'rake'}, 
{'name': 'symfony2', 'command': 'symfony'}, {'name': 'systemd', 'command': 'systemctl'}, 'python', {'name': 'tmux', 'command': 'tmux'}, 
{'name': 'vagrant', 'command': 'vagrant'}, {'name': 'viasite/drall', 'command': 'drall'}, {'name': 'viasite/drupal-scripts', 'command': 'drs'}, 
{'name': 'viasite/server-scripts', 'command': 'dbdump'}, {'name': 'viasite-ansible/zsh-ansible-server', 'command': 'ansible-deploy'}, 'zsh_reload', 
{'name': 'zsh-users/zsh-autosuggestions', 'when': \"{{ zsh_version | default(false) | version('5.0', '>=') }}\"}, 'popstas/zsh-command-time', 
{'name': 'unixorn/autoupdate-antigen.zshplugin', 'when': '{{ zsh_update_interval > 0 }}'}, 'urbainvaes/fzf-marks', '{{ fzf_widgets }}', 
{'name': 'zdharma/[email protected]', 'when': \"{{ zsh_version | default(false) | version('4.3.17', '>=') }}\"}]'. Error was a 
<class 'ansible.errors.AnsibleFilterError'>, 
original message: Version comparison: '<' not supported between instances of 'str' and 'int'"}
...ignoring

numediaweb avatar Jan 17 '22 10:01 numediaweb

Hello! Have not Vargant installed now.

Can you try to replace in Vagrantfile in first line 16.04 to 20.04, maybe old python or ansible in Vagrant...

If it not help, you can edit defaults/main.yml and remove when options in plugins zsh-users/zsh-autosuggestions and zdharma-continuum/fast-syntax-highlighting:

- { name: zsh-users/zsh-autosuggestions, when: "{{ zsh_version is version_compare('5.0', '>=') }}" }
- { name: zdharma-continuum/fast-syntax-highlighting, when: "{{ zsh_version is version_compare('4.3.17', '>=') }}" }

Replace to:

- { name: zsh-users/zsh-autosuggestions }
- { name: zdharma-continuum/fast-syntax-highlighting }

popstas avatar Jan 18 '22 17:01 popstas

Won't fix

popstas avatar Jul 16 '23 21:07 popstas