Module: Chef::Sugar::Platform
Constant Summary collapse
- PLATFORM_VERSIONS =
{ 'debian' => { 'squeeze' => '6', 'wheezy' => '7', 'jessie' => '8', }, 'linuxmint' => { 'qiana' => '17', 'petra' => '16', 'olivia' => '15', 'nadia' => '14', 'maya' => '13', 'lisa' => '12', }, 'mac_os_x' => { 'lion' => '10.7', 'mountain_lion' => '10.8', 'mavericks' => '10.9', 'yosemite' => '10.10', }, 'solaris' => { '7' => '5.7', '8' => '5.8', '9' => '5.9', '10' => '5.10', '11' => '5.11', }, 'ubuntu' => { 'lucid' => '10.04', 'maverick' => '10.10', 'natty' => '11.04', 'oneiric' => '11.10', 'precise' => '12.04', 'quantal' => '12.10', 'raring' => '13.04', 'saucy' => '13.10', 'trusty' => '14.04', }, }
- COMPARISON_OPERATORS =
{ 'after' => ->(a, b) { a > b }, 'after_or_at' => ->(a, b) { a >= b }, '' => ->(a, b) { a == b }, 'before' => ->(a, b) { a < b }, 'before_or_at' => ->(a, b) { a <= b }, }
Instance Method Summary collapse
-
#aix?(node) ⇒ Boolean
Determine if the current node is aix.
-
#amazon_linux?(node) ⇒ Boolean
(also: #amazon?)
Determine if the current node is amazon linux.
-
#centos?(node) ⇒ Boolean
Determine if the current node is centos.
-
#debian_platform?(node) ⇒ Boolean
Determine if the current node is debian (platform, not platform_family).
-
#fedora_platform?(node) ⇒ Boolean
Determine if the current node is fedora (platform, not platform_family).
-
#ios_xr?(node) ⇒ Boolean
Determine if the current node is a Cisco IOS-XR device.
-
#linux_mint?(node) ⇒ Boolean
(also: #mint?)
Determine if the current node is linux mint.
-
#nexus?(node) ⇒ Boolean
Determine if the current node is a Cisco nexus device.
-
#omnios?(node) ⇒ Boolean
Determine if the current node is omnios.
-
#oracle_linux?(node) ⇒ Boolean
(also: #oracle?)
Determine if the current node is oracle linux.
-
#platform_version(node) ⇒ Chef::Sugar::Constraints::Version
Return the platform_version for the node.
-
#raspbian?(node) ⇒ Boolean
Determine if the current node is raspbian.
-
#redhat_enterprise_linux?(node) ⇒ Boolean
(also: #redhat_enterprise?)
Determine if the current node is redhat enterprise.
-
#scientific_linux?(node) ⇒ Boolean
(also: #scientific?)
Determine if the current node is scientific linux.
-
#smartos?(node) ⇒ Boolean
Determine if the current node is smartos.
-
#solaris2?(node) ⇒ Boolean
(also: #solaris?)
Determine if the current node is solaris2.
-
#ubuntu?(node) ⇒ Boolean
Determine if the current node is ubuntu.
Instance Method Details
#aix?(node) ⇒ Boolean
Determine if the current node is aix
217 218 219 |
# File 'lib/chef/sugar/platform.rb', line 217 def aix?(node) node['platform'] == 'aix' end |
#amazon_linux?(node) ⇒ Boolean Also known as: amazon?
Determine if the current node is amazon linux.
135 136 137 |
# File 'lib/chef/sugar/platform.rb', line 135 def amazon_linux?(node) node['platform'] == 'amazon' end |
#centos?(node) ⇒ Boolean
Determine if the current node is centos.
147 148 149 |
# File 'lib/chef/sugar/platform.rb', line 147 def centos?(node) node['platform'] == 'centos' end |
#debian_platform?(node) ⇒ Boolean
Determine if the current node is debian (platform, not platform_family).
124 125 126 |
# File 'lib/chef/sugar/platform.rb', line 124 def debian_platform?(node) node['platform'] == 'debian' end |
#fedora_platform?(node) ⇒ Boolean
Determine if the current node is fedora (platform, not platform_family).
194 195 196 |
# File 'lib/chef/sugar/platform.rb', line 194 def fedora_platform?(node) node['platform'] == 'fedora' end |
#ios_xr?(node) ⇒ Boolean
Determine if the current node is a Cisco IOS-XR device
272 273 274 |
# File 'lib/chef/sugar/platform.rb', line 272 def ios_xr?(node) node['platform'] == 'ios_xr' end |
#linux_mint?(node) ⇒ Boolean Also known as: mint?
Determine if the current node is linux mint.
101 102 103 |
# File 'lib/chef/sugar/platform.rb', line 101 def linux_mint?(node) node['platform'] == 'linuxmint' end |
#nexus?(node) ⇒ Boolean
Determine if the current node is a Cisco nexus device
261 262 263 |
# File 'lib/chef/sugar/platform.rb', line 261 def nexus?(node) node['platform'] == 'nexus' end |
#omnios?(node) ⇒ Boolean
Determine if the current node is omnios
239 240 241 |
# File 'lib/chef/sugar/platform.rb', line 239 def omnios?(node) node['platform'] == 'omnios' end |
#oracle_linux?(node) ⇒ Boolean Also known as: oracle?
Determine if the current node is oracle linux.
158 159 160 |
# File 'lib/chef/sugar/platform.rb', line 158 def oracle_linux?(node) node['platform'] == 'oracle' end |
#platform_version(node) ⇒ Chef::Sugar::Constraints::Version
Return the platform_version for the node. Acts like a String but also provides a mechanism for checking version constraints.
284 285 286 |
# File 'lib/chef/sugar/platform.rb', line 284 def platform_version(node) Chef::Sugar::Constraints::Version.new(node['platform_version']) end |
#raspbian?(node) ⇒ Boolean
Determine if the current node is raspbian
250 251 252 |
# File 'lib/chef/sugar/platform.rb', line 250 def raspbian?(node) node['platform'] == 'raspbian' end |
#redhat_enterprise_linux?(node) ⇒ Boolean Also known as: redhat_enterprise?
Determine if the current node is redhat enterprise.
182 183 184 |
# File 'lib/chef/sugar/platform.rb', line 182 def redhat_enterprise_linux?(node) node['platform'] == 'redhat' end |
#scientific_linux?(node) ⇒ Boolean Also known as: scientific?
Determine if the current node is scientific linux.
170 171 172 |
# File 'lib/chef/sugar/platform.rb', line 170 def scientific_linux?(node) node['platform'] == 'scientific' end |
#smartos?(node) ⇒ Boolean
Determine if the current node is smartos
228 229 230 |
# File 'lib/chef/sugar/platform.rb', line 228 def smartos?(node) node['platform'] == 'smartos' end |
#solaris2?(node) ⇒ Boolean Also known as: solaris?
Determine if the current node is solaris2
205 206 207 |
# File 'lib/chef/sugar/platform.rb', line 205 def solaris2?(node) node['platform'] == 'solaris2' end |
#ubuntu?(node) ⇒ Boolean
Determine if the current node is ubuntu.
113 114 115 |
# File 'lib/chef/sugar/platform.rb', line 113 def ubuntu?(node) node['platform'] == 'ubuntu' end |