Module: Chef::Sugar::Virtualization
- Extended by:
- Virtualization
- Included in:
- Virtualization
- Defined in:
- lib/chef/sugar/virtualization.rb
Instance Method Summary collapse
-
#kvm?(node) ⇒ Boolean
Determine if the current node is running under KVM.
-
#lxc?(node) ⇒ Boolean
Determine if the current node is running in a linux container.
-
#openvz?(node) ⇒ Boolean
Determine if the current node is running under openvz.
-
#parallels?(node) ⇒ Boolean
Determine if the current node is running under Parallels Desktop.
- #physical?(node) ⇒ Boolean
- #virtual?(node) ⇒ Boolean
-
#virtualbox?(node) ⇒ Boolean
Determine if the current node is running under VirtualBox.
-
#vmware?(node) ⇒ Boolean
Determine if the current node is running under VMware.
Instance Method Details
#kvm?(node) ⇒ Boolean
Determine if the current node is running under KVM.
31 32 33 |
# File 'lib/chef/sugar/virtualization.rb', line 31 def kvm?(node) node.key?('virtualization') && node['virtualization']['system'] == 'kvm' end |
#lxc?(node) ⇒ Boolean
Determine if the current node is running in a linux container.
44 45 46 |
# File 'lib/chef/sugar/virtualization.rb', line 44 def lxc?(node) node.key?('virtualization') && node['virtualization']['system'] == 'lxc' end |
#openvz?(node) ⇒ Boolean
Determine if the current node is running under openvz.
96 97 98 |
# File 'lib/chef/sugar/virtualization.rb', line 96 def openvz?(node) node.key?('virtualization') && node['virtualization']['system'] == 'openvz' end |
#parallels?(node) ⇒ Boolean
Determine if the current node is running under Parallels Desktop.
57 58 59 |
# File 'lib/chef/sugar/virtualization.rb', line 57 def parallels?(node) node.key?('virtualization') && node['virtualization']['system'] == 'parallels' end |
#physical?(node) ⇒ Boolean
104 105 106 |
# File 'lib/chef/sugar/virtualization.rb', line 104 def physical?(node) !virtual?(node) end |
#virtual?(node) ⇒ Boolean
100 101 102 |
# File 'lib/chef/sugar/virtualization.rb', line 100 def virtual?(node) openvz?(node) || vmware?(node) || virtualbox?(node) || parallels?(node) || lxc?(node) || kvm?(node) end |
#virtualbox?(node) ⇒ Boolean
Determine if the current node is running under VirtualBox.
70 71 72 |
# File 'lib/chef/sugar/virtualization.rb', line 70 def virtualbox?(node) node.key?('virtualization') && node['virtualization']['system'] == 'vbox' end |
#vmware?(node) ⇒ Boolean
Determine if the current node is running under VMware.
83 84 85 |
# File 'lib/chef/sugar/virtualization.rb', line 83 def vmware?(node) node.key?('virtualization') && node['virtualization']['system'] == 'vmware' end |