7325aca987
Change-Id: I8cbb919c39bdb099eaec076c7bcf2ea0b84a6475
27 lines
702 B
YAML
27 lines
702 B
YAML
- name: Check if bazelisk is installed
|
|
command: bash -c "type -p {{ bazelisk_executable }}"
|
|
failed_when: false
|
|
register: bazelisk_installed
|
|
|
|
- name: Ensure target directory exists
|
|
file:
|
|
state: directory
|
|
path: "{{ bazelisk_target | dirname }}"
|
|
mode: 0755
|
|
when: bazelisk_installed.rc != 0
|
|
|
|
- name: Download bazelisk
|
|
get_url:
|
|
url: "{{ bazelisk_url }}"
|
|
dest: "{{ bazelisk_target }}"
|
|
mode: '0755'
|
|
when: bazelisk_installed.rc != 0
|
|
register: bazelisk_downloaded
|
|
|
|
# This will apply to further plays and playbooks
|
|
- name: Set bazelisk_executable fact
|
|
set_fact:
|
|
bazelisk_executable: "{{ bazelisk_target }}"
|
|
cacheable: true
|
|
when: bazelisk_downloaded is changed
|