lib/chef/sugar/virtualization.rb in chef-sugar-3.3.0 vs lib/chef/sugar/virtualization.rb in chef-sugar-3.4.0
- old
+ new
@@ -81,10 +81,18 @@
# otherwise
#
def openvz?(node)
node.key?('virtualization') && node['virtualization']['system'] == 'openvz'
end
+
+ def virtual?(node)
+ openvz?(node) || vmware?(node) || virtualbox?(node) || lxc?(node) || kvm?(node)
+ end
+
+ def physical?(node)
+ !virtual?(node)
+ end
end
module DSL
# @see Chef::Sugar::Virtualization#kvm?
def kvm?; Chef::Sugar::Virtualization.kvm?(node); end
@@ -98,8 +106,14 @@
# @see Chef::Sugar::Virtualization#vmware?
def vmware?; Chef::Sugar::Virtualization.vmware?(node); end
# @see Chef::Sugar::Virtualization#openvz?
def openvz?; Chef::Sugar::Virtualization.openvz?(node); end
+
+ # @see Chef::Sugar::Virtualization#virtual?
+ def virtual?; Chef::Sugar::Virtualization.virtual?(node); end
+
+ # @see Chef::Sugar::Virtualization#physical?
+ def physical?; Chef::Sugar::Virtualization.physical?(node); end
end
end
end