install-yarn: always install

The role previously conditionally installed YARN only if there was
a yarn.lock.  The role shouldn't conditionally decide to install
if there is a yarn.lock file as that's not expected behaviour.

Change-Id: Ia6940df036fd27d55d60fa959b794de952040745
This commit is contained in:
Mohammed Naser 2020-04-04 15:58:19 -04:00 committed by Andreas Jaeger
parent 7cb1c6b16b
commit f2976b1274
4 changed files with 10 additions and 36 deletions

View File

@ -1,13 +1 @@
Install yarn from yarnpkg repos
**Role Variables**
.. zuul:rolevar:: zuul_work_dir
:default: {{ zuul.project.src_dir }}
The directory to work in.
.. zuul:rolevar:: yarn_lock_file_path
:default: {{ zuul_work_dir }}/yarn.lock
Path to yarn.lock file used by a project.

View File

@ -1,2 +0,0 @@
zuul_work_dir: "{{ zuul.project.src_dir }}"
yarn_lock_file_path: "{{ zuul_work_dir }}/yarn.lock"

View File

@ -21,15 +21,14 @@
repositories_keys: "{{ _yarn_keys | default([]) }}"
repositories_list: "{{ _yarn_repos | default([]) }}"
- name: Check for yarn.lock file
stat:
path: "{{ yarn_lock_file_path }}"
get_checksum: false
get_mime: false
get_md5: false
register: yarn_lock
- name: Install yarn from yarnpkg.com
package:
name: yarn
state: latest
become: yes
tags:
# Ignore ANSIBLE0010: We really want latest version
- skip_ansible_lint
- name: Install yarn if needed
include: yarn.yaml
when:
- yarn_lock.stat.exists
- name: Output yarn version
command: yarn --version

View File

@ -1,11 +0,0 @@
- name: Install yarn from yarnpkg.com
package:
name: yarn
state: latest
become: yes
tags:
# Ignore ANSIBLE0010: We really want latest version
- skip_ansible_lint
- name: Output yarn version
command: yarn --version