From dbd597e1dfde9eba2b7e63e917039aba1000bbef Mon Sep 17 00:00:00 2001 From: vincent Date: Sun, 22 Sep 2019 12:49:16 +0200 Subject: [PATCH] implement bat instalaiton for debian --- defaults/main.yml | 6 ++++-- tasks/base_software.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 6f6c30b..3e4a2d5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -45,7 +45,7 @@ system_base_softwares_arch: system_base_softwares_debian: - 'zsh' - 'stow' - #- 'wol' + - 'wakeonlan' - 'nmap' #- 'bind-tools' - 'rsync' @@ -70,4 +70,6 @@ system_base_softwares_debian: - 'zip' - 'unzip' - 'unrar' - - 'git-lfs' \ No newline at end of file + - 'git-lfs' + + diff --git a/tasks/base_software.yml b/tasks/base_software.yml index 1720c85..28733ce 100644 --- a/tasks/base_software.yml +++ b/tasks/base_software.yml @@ -35,3 +35,32 @@ pip: name: powerline-status # not required. The name of a Python library to install or the url(bzr+,hg+,git+,svn+) of the remote package.,This can be a list (since 2.2) and contain version specifiers (since 2.7). extra_args: --user + + +- name: GITHUB | Get current version of bat + shell: > + warn=False + 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 + failed_when: > + command_result.rc != 0 or + not command_result.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" + when: ansible_facts['os_family'] == "Debian" + +- name: DEBIAN | Install deb from github + become: true + apt: + deb: "{{debian_url}}" + when: ansible_facts['os_family'] == "Debian" \ No newline at end of file