feat: use builtin virtualisation detection

This commit is contained in:
Simon Cornet 2026-04-10 14:23:17 +02:00
commit 02d15fb57a
6 changed files with 15 additions and 14 deletions

View file

@ -42,8 +42,8 @@
- name: "swap"
ansible.builtin.import_tasks: "swap.yaml"
when:
- 'type == "vm"'
- "ansible_os_family =='Debian'"
- "ansible_virtualization_type == 'kvm'"
tags: "swap"
@ -116,7 +116,7 @@
# chrony
- name: "ntp"
ansible.builtin.import_tasks: "ntp.yaml"
when: 'type == "vm" or type == "hw"'
when: "ansible_virtualization_type == 'kvm'"
tags: "ntp"
# flush handler
@ -140,8 +140,8 @@
- name: "lxd"
ansible.builtin.import_tasks: "lxd.yaml"
when:
- 'type == "vm"'
- "ansible_os_family == 'Debian'"
- "ansible_os_family =='Debian'"
- "ansible_virtualization_type == 'kvm'"
tags: "lxd"
# flush handler
@ -151,7 +151,7 @@
# sysctl
- name: "sysctl - set sysctl"
ansible.builtin.import_tasks: "sysctl.yaml"
when: 'type == "vm" or type == "hw"'
when: "ansible_virtualization_type == 'kvm'"
tags: "sysctl"
# systemctl
@ -161,8 +161,8 @@
loop_control:
loop_var: "__systemctl"
when:
- 'type == "vm"'
- "ansible_os_family == 'Debian'"
- "ansible_os_family =='Debian'"
- "ansible_virtualization_type == 'kvm'"
tags: "systemctl"
# syslog