Improve bat role

This commit is contained in:
2022-08-27 17:40:00 +01:00
parent 189371d7f2
commit 76b6d63064
5 changed files with 95 additions and 11 deletions

View File

@@ -1,13 +1,13 @@
---
- name: install apt package
become: true
apt:
name: bat
state: latest
- set_fact:
use_github: '{{
ansible_distribution == "Ubuntu" and
ansible_distribution_version == "18.04"
}}'
- debug: msg={{use_github}}
- name: update bat alternative
become: true
alternatives:
name: bat
path: /usr/bin/batcat
link: /usr/local/bin/bat
- when: use_github
include_tasks: deb.yaml
- when: not use_github
include_tasks: apt.yaml