local/roles/llvm/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
575 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 }}"
- include_tasks: Ubuntu.yaml
when: "'ID_LIKE' in os_release and os_release.ID_LIKE == 'ubuntu debian'"
- name: install apt packages
when: "'ID_LIKE' not in os_release"
become: true
apt:
name:
- clang
- clang-format
- clang-tidy
- clang-tools
- clangd
- llvm
state: latest
install_recommends: true