module Chef::Sugar::Platform
Constants
- COMPARISON_OPERATORS
- PLATFORM_VERSIONS
Public Instance Methods
Determine if the current node is aix
@param [Chef::Node] node
@return [Boolean]
# File lib/chef/sugar/platform.rb, line 249 def aix?(node) node['platform'] == 'aix' end
Determine if the current node is amazon linux.
@param [Chef::Node] node
@return [Boolean]
# File lib/chef/sugar/platform.rb, line 167 def amazon_linux?(node) node['platform'] == 'amazon' end
Determine if the current node is centos.
@param [Chef::Node] node
@return [Boolean]
# File lib/chef/sugar/platform.rb, line 179 def centos?(node) node['platform'] == 'centos' end
Determine if the current node is debian (platform, not platform_family).
@param [Chef::Node] node
@return [Boolean]
# File lib/chef/sugar/platform.rb, line 156 def debian_platform?(node) node['platform'] == 'debian' end
Determine if the current node is fedora (platform, not platform_family).
@param [Chef::Node] node
@return [Boolean]
# File lib/chef/sugar/platform.rb, line 226 def fedora_platform?(node) node['platform'] == 'fedora' end
Determine if the current node is a Cisco IOS-XR device
@param [Chef::Node] node
@return [Boolean]
# File lib/chef/sugar/platform.rb, line 304 def ios_xr?(node) node['platform'] == 'ios_xr' end
Determine if the current node is linux mint.
@param [Chef::Node] node
@return [Boolean]
# File lib/chef/sugar/platform.rb, line 133 def linux_mint?(node) node['platform'] == 'linuxmint' end
Determine if the current node is a Cisco nexus device
@param [Chef::Node] node
@return [Boolean]
# File lib/chef/sugar/platform.rb, line 293 def nexus?(node) node['platform'] == 'nexus' end
Determine if the current node is omnios
@param [Chef::Node] node
@return [Boolean]
# File lib/chef/sugar/platform.rb, line 271 def omnios?(node) node['platform'] == 'omnios' end
Determine if the current node is oracle linux.
@param [Chef::Node] node
@return [Boolean]
# File lib/chef/sugar/platform.rb, line 190 def oracle_linux?(node) node['platform'] == 'oracle' end
Return the platform_version
for the node. Acts like a String
but also provides a mechanism for checking version constraints.
@param [Chef::Node] node
@return [Chef::Sugar::Constraints::Version]
# File lib/chef/sugar/platform.rb, line 318 def platform_version(node) Chef::Sugar::Constraints::Version.new(node['platform_version']) end
Determine if the current node is raspbian
@param [Chef::Node] node
@return [Boolean]
# File lib/chef/sugar/platform.rb, line 282 def raspbian?(node) node['platform'] == 'raspbian' end
Determine if the current node is redhat enterprise.
@param [Chef::Node] node
@return [Boolean]
# File lib/chef/sugar/platform.rb, line 214 def redhat_enterprise_linux?(node) node['platform'] == 'redhat' end
Determine if the current node is scientific linux.
@param [Chef::Node] node
@return [Boolean]
# File lib/chef/sugar/platform.rb, line 202 def scientific_linux?(node) node['platform'] == 'scientific' end
Determine if the current node is smartos
@param [Chef::Node] node
@return [Boolean]
# File lib/chef/sugar/platform.rb, line 260 def smartos?(node) node['platform'] == 'smartos' end
Determine if the current node is solaris2
@param [Chef::Node] node
@return [Boolean]
# File lib/chef/sugar/platform.rb, line 237 def solaris2?(node) node['platform'] == 'solaris2' end
Determine if the current node is ubuntu.
@param [Chef::Node] node
@return [Boolean]
# File lib/chef/sugar/platform.rb, line 145 def ubuntu?(node) node['platform'] == 'ubuntu' end