local/roles/neovim/tasks/Debian.yaml
Kenneth Benzie (Benie) df00529f86 Use /etc/os-release to ID Ubuntu/Debian
Ansible facts aren't always enough to determine if a distro is derived
from Ubuntu or not, this is available from `/etc/os-release` when it
contains `ID_LIKE="ubuntu debian"`. This patch uses `/etc/os-release` to
correctly handle Ubuntu installations, e.g. PPA's, for all Ubuntu
derived dirtros rather than just Ubuntu itself.
2023-08-01 19:14:32 +01:00

26 lines
560 B
YAML

---
- name: slurp /etc/os-release
slurp:
src: /etc/os-release
register: os_release_slurp
- set_fact:
os_release: "{{ os_release_slurp.content |
b64decode | trim() | replace('=', ': ') | from_yaml }}"
- name: add neovim stable ppa
when: "'ID_LIKE' in os_release and os_release.ID_LIKE == 'ubuntu debian'"
become: true
apt_repository:
repo: ppa:neovim-ppa/stable
update_cache: true
- name: install apt package
become: true
apt:
name:
- neovim
- python3-neovim
state: latest
- include_tasks: Unix.yaml