Patch for FACT-660 Facter on Solaris 11.2+ should report if zones are supported
Upstream bug: https://tickets.puppetlabs.com/browse/FACT-660
--- facter-2.4.6/lib/facter/util/solaris_zones.rb.orig 2016-04-19 15:21:42.808586315 -0700
+++ facter-2.4.6/lib/facter/util/solaris_zones.rb 2016-04-19 15:22:05.762477352 -0700
@@ -1,3 +1,7 @@
+#######################################################################
+# Oracle has modified the originally distributed contents of this file.
+#######################################################################
+
require 'facter/util/resolution'
module Facter
@@ -156,3 +160,29 @@
end
end
end
+
+Facter.add("kernel_zone") do
+ confine :operatingsystem => :Solaris
+ setcode do
+ virtinfo = %x{/sbin/virtinfo list -H -o class kernel-zone 2>/dev/null}
+ case virtinfo.chomp!
+ when "supported", "current", "parent"
+ virtinfo
+ else
+ "unsupported"
+ end
+ end
+end
+
+Facter.add("non_global_zone") do
+ confine :operatingsystem => :Solaris
+ setcode do
+ virtinfo = %x{/sbin/virtinfo list -H -o class non-global-zone 2>/dev/null}
+ case virtinfo.chomp!
+ when "supported", "current"
+ virtinfo
+ else
+ "unsupported"
+ end
+ end
+end