From 1b40c402500f4a7df439bf2c6b0bab5084f5e676 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Thu, 17 Aug 2017 11:19:49 +0200 Subject: [PATCH] add a virt facter based on systemd --- modules/debian_org/lib/facter/virt.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 modules/debian_org/lib/facter/virt.rb diff --git a/modules/debian_org/lib/facter/virt.rb b/modules/debian_org/lib/facter/virt.rb new file mode 100644 index 000000000..b5b318bc9 --- /dev/null +++ b/modules/debian_org/lib/facter/virt.rb @@ -0,0 +1,10 @@ +Facter.add("virt") do + setcode do + begin + `systemd-detect-virt`.chomp() + rescue Errno::ENOENT + nil + end + end +end +p -- 2.20.1