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.
26 lines
575 B
YAML
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
|