check bat version

This commit is contained in:
vincent 2019-10-03 21:22:20 +02:00
parent dbd597e1df
commit 26f8a4203f

View File

@ -43,20 +43,16 @@
curl --silent https://github.com/sharkdp/bat/releases/latest | curl --silent https://github.com/sharkdp/bat/releases/latest |
grep 'tag' | grep 'tag' |
sed -E 's/.*v([0-9].[0-9][0-9].[0-9]).*/\1/' sed -E 's/.*v([0-9].[0-9][0-9].[0-9]).*/\1/'
register: command_result register: bat_version
failed_when: > failed_when: >
command_result.rc != 0 or bat_version.rc != 0 or
not command_result.stdout|regex_search('\w+\.\w+\.\w+') not bat_version.stdout|regex_search('\w+\.\w+\.\w+')
when: ansible_facts['os_family'] == "Debian" when: ansible_facts['os_family'] == "Debian"
- name: GITHUB | Set latest version of bat
set_fact:
bat_version: "{{ command_result.stdout }}"
when: ansible_facts['os_family'] == "Debian"
- name: DEBIAN | Set URL to download bins - name: DEBIAN | Set URL to download bins
set_fact: set_fact:
debian_url: "https://github.com/sharkdp/bat/releases/download/v{{ bat_version }}/bat_{{ bat_version }}_amd64.deb" debian_url: "https://github.com/sharkdp/bat/releases/download/v{{ bat_version.stdout }}/bat_{{ bat_version.stdout }}_amd64.deb"
when: ansible_facts['os_family'] == "Debian" when: ansible_facts['os_family'] == "Debian"
- name: DEBIAN | Install deb from github - name: DEBIAN | Install deb from github