module ChefUtils::DSL::Platform
Public Instance Methods
Determine if the current node is AIX.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 261 def aix_platform?(node = __getnode) node["platform"] == "aix" end
Determine if the current node is Amazon Linux.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 92 def amazon_platform?(node = __getnode) node["platform"] == "amazon" end
Determine if the current node is Arch Linux
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 202 def arch_platform?(node = __getnode) node["platform"] == "arch" end
Determine if the current node is CentOS.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 120 def centos_platform?(node = __getnode) node["platform"] == "centos" end
Determine if the current node is CentOS Stream.
@param [Chef::Node] node the node to check @since 17.0
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 133 def centos_stream_platform?(node = __getnode) if node["os_release"] node.dig("os_release", "name") == "CentOS Stream" else node.dig("lsb", "id") == "CentOSStream" end end
Determine if the current node is ClearOS.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 178 def clearos_platform?(node = __getnode) node["platform"] == "clearos" end
Determine if the current node is Debian.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 81 def debian_platform?(node = __getnode) node["platform"] == "debian" end
Determine if the current node is DragonFly BSD.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 305 def dragonfly_platform?(node = __getnode) node["platform"] == "dragonfly" end
Determine if the current node is Fedora.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 191 def fedora_platform?(node = __getnode) node["platform"] == "fedora" end
Determine if the current node is FreeBSD.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 272 def freebsd_platform?(node = __getnode) node["platform"] == "freebsd" end
Determine if the current node is Gentoo.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 329 def gentoo_platform?(node = __getnode) node["platform"] == "gentoo" end
Determine if the current node is linux mint.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 38 def linuxmint_platform?(node = __getnode) node["platform"] == "linuxmint" end
Determine if the current node is macOS.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 316 def macos_platform?(node = __getnode) node["platform"] == "mac_os_x" end
Determine if the current node is NetBSD.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 294 def netbsd_platform?(node = __getnode) node["platform"] == "netbsd" end
Determine if the current node is OmniOS.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 235 def omnios_platform?(node = __getnode) node["platform"] == "omnios" end
Determine if the current node is OpenBSD.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 283 def openbsd_platform?(node = __getnode) node["platform"] == "openbsd" end
Determine if the current node is OpenIndiana.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 248 def openindiana_platform?(node = __getnode) node["platform"] == "openindiana" end
Determine if the current node is openSUSE.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 362 def opensuse_platform?(node = __getnode) node["platform"] == "opensuse" || node["platform"] == "opensuseleap" end
Determine if the current node is Oracle Linux.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 148 def oracle_platform?(node = __getnode) node["platform"] == "oracle" end
Determine if the current node is Raspbian.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 68 def raspbian_platform?(node = __getnode) node["platform"] == "raspbian" end
Determine if the current node is Red Hat Enterprise Linux.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 103 def redhat_platform?(node = __getnode) node["platform"] == "redhat" end
Determine if the current node is Scientific Linux.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 163 def scientific_platform?(node = __getnode) node["platform"] == "scientific" end
Determine if the current node is Slackware.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 340 def slackware_platform?(node = __getnode) node["platform"] == "slackware" end
Determine if the current node is SmartOS.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 224 def smartos_platform?(node = __getnode) node["platform"] == "smartos" end
Determine if the current node is Solaris2.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 213 def solaris2_platform?(node = __getnode) node["platform"] == "solaris2" end
Determine if the current node is SuSE.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 351 def suse_platform?(node = __getnode) node["platform"] == "suse" end
Determine if the current node is Ubuntu.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 55 def ubuntu_platform?(node = __getnode) node["platform"] == "ubuntu" end
Determine if the current node is Windows
.
@param [Chef::Node] node the node to check @since 15.5
@return [Boolean]
# File lib/chef-utils/dsl/platform.rb, line 380 def windows_platform?(node = __getnode) node["platform"] == "windows" end