From 26f8a4203f9f6126c46596273ddadc9368d9ca98 Mon Sep 17 00:00:00 2001 From: vincent Date: Thu, 3 Oct 2019 21:22:20 +0200 Subject: [PATCH] check bat version --- tasks/base_software.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tasks/base_software.yml b/tasks/base_software.yml index 28733ce..2acae9b 100644 --- a/tasks/base_software.yml +++ b/tasks/base_software.yml @@ -43,20 +43,16 @@ curl --silent https://github.com/sharkdp/bat/releases/latest | grep 'tag' | sed -E 's/.*v([0-9].[0-9][0-9].[0-9]).*/\1/' - register: command_result + register: bat_version failed_when: > - command_result.rc != 0 or - not command_result.stdout|regex_search('\w+\.\w+\.\w+') + bat_version.rc != 0 or + not bat_version.stdout|regex_search('\w+\.\w+\.\w+') 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 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" - name: DEBIAN | Install deb from github