1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Return correct values when running yarn in check mode (#153)

* Fixes Check Mode

* Adds parenthesis

* Adds changelog and tests
This commit is contained in:
Jose Angel Munoz 2020-06-17 17:39:24 +02:00 committed by GitHub
parent 02a032aa45
commit 54014529bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 1 deletions

View file

@ -0,0 +1,3 @@
---
bugfixes:
- yarn - Return correct values when running yarn in check mode (https://github.com/ansible-collections/community.general/pull/153).

View file

@ -218,7 +218,7 @@ class Yarn(object):
rc, out, err = self.module.run_command(cmd, check_rc=check_rc, cwd=cwd)
return out, err
return ''
return(None, None)
def list(self):
cmd = ['list', '--depth=0', '--json']

View file

@ -69,6 +69,24 @@
that:
- not (yarn_install is changed)
- name: 'Install all packages in check mode.'
yarn:
path: '{{ output_dir }}'
executable: '{{ yarn_bin_path }}/yarn'
state: present
environment:
PATH: '{{ node_bin_path }}:{{ ansible_env.PATH }}'
check_mode: true
register: yarn_install_check
- name: verify test yarn global installation in check mode
assert:
that:
- yarn_install_check.err is defined
- yarn_install_check.out is defined
- yarn_install_check.err is none
- yarn_install_check.out is none
- name: 'Install package with explicit version (older version of package)'
yarn:
path: '{{ output_dir }}'