-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
yarn: #5829 causes "global dir" and "global: GTAGS not found." error #6132
Comments
Files identified in the description: If these files are incorrect, please update the |
Ah I see, this line executes before the path to Yarn is identified from the PATH if it wasn't passed explicitly: module.run_command([executable, 'global', 'dir'], check_rc=True) |
Pulling this logic out of the initializer so it runs before the above line should fix it: if kwargs['executable']:
self.executable = kwargs['executable'].split(' ')
else:
self.executable = [module.get_bin_path('yarn', True)] |
And since the tests all explicitly set the - name: 'Global install binary with explicit version (older version of package)'
yarn:
global: true
executable: '{{ yarn_bin_path }}/yarn' # THIS LINE
name: prettier
version: 2.0.0
state: present
environment:
PATH: '{{ node_bin_path }}:{{ ansible_env.PATH }}'
register: yarn_global_install_old_binary Will file a PR soon, but a workaround to get y'all unblocked might work something like this: - name: example
yarn:
global: true
executable: "{{ lookup('lines', 'which yarn') }}" # THIS LINE
name: prettier
version: 2.0.0
state: present |
Summary
I am doing
yarn global add ...
in ansible-core version 2.14.3 and experiencing this error that doesn't happen in the previous 2.14.2 version. I have investigated that the cause is from the pull request #5829That is because it can't detect yarn as an executable in this line of code.
https://github.com/ansible-collections/community.general/pull/5829/files#diff-baebe07da57aab76abf01ac7c4b8d6730b6111f18813e93a898a217c752568d3R343
So it runs
global dir
instead of the expectedyarn global dir
command.Issue Type
Bug Report
Component Name
yarn
Ansible Version
Community.general Version
Configuration
OS / Environment
A docker container running Ubuntu 22.04 image
Steps to Reproduce
Expected Results
It should run
yarn global dir
Actual Results
It runs "global dir" instead (missing yarn)
Code of Conduct
The text was updated successfully, but these errors were encountered: