module Chef::Sugar::Architecture

Public Instance Methods

_32_bit?(node) click to toggle source

Determine if the current architecture is 32-bit

@todo Make this more than “not 64-bit”

@return [Boolean]

# File lib/chef/sugar/architecture.rb, line 41
def _32_bit?(node)
  !_64_bit?(node)
end
_64_bit?(node) click to toggle source

Determine if the current architecture is 64-bit

@return [Boolean]

# File lib/chef/sugar/architecture.rb, line 29
def _64_bit?(node)
  %w(amd64 x86_64 ppc64 ppc64le s390x ia64 sparc64 aarch64 arch64 arm64 sun4v sun4u s390x)
    .include?(node['kernel']['machine']) || ( node['kernel']['bits'] == '64' )
end
aarch64?(node) click to toggle source

Determine if the current architecture is AArch64

@return [Boolean]

# File lib/chef/sugar/architecture.rb, line 120
def aarch64?(node)
  # Add more arm variants as needed here
  %w(aarch64)
    .include?(node['kernel']['machine'])
end
armhf?(node) click to toggle source

Determine if the current architecture is ARM with Hard Float

@return [Boolean]

# File lib/chef/sugar/architecture.rb, line 109
def armhf?(node)
  # Add more arm variants as needed here
  %w(armv6l armv7l)
    .include?(node['kernel']['machine'])
end
i386?(node) click to toggle source

Determine if the current architecture is i386

@return [Boolean]

# File lib/chef/sugar/architecture.rb, line 50
def i386?(node)
  _32_bit?(node) && intel?(node)
end
intel?(node) click to toggle source

Determine if the current architecture is Intel.

@return [Boolean]

# File lib/chef/sugar/architecture.rb, line 59
def intel?(node)
  %w(i86pc i386 x86_64 amd64 i686)
    .include?(node['kernel']['machine'])
end
powerpc?(node) click to toggle source

Determine if the current architecture is PowerPC

@return [Boolean]

# File lib/chef/sugar/architecture.rb, line 99
def powerpc?(node)
  %w(powerpc)
    .include?(node['kernel']['machine'])
end
ppc64?(node) click to toggle source

Determine if the current architecture is Powerpc64 Big Endian

@return [Boolean]

# File lib/chef/sugar/architecture.rb, line 79
def ppc64?(node)
  %w(ppc64)
    .include?(node['kernel']['machine'])
end
ppc64le?(node) click to toggle source

Determine if the current architecture is Powerpc64 Little Endian

@return [Boolean]

# File lib/chef/sugar/architecture.rb, line 89
def ppc64le?(node)
  %w(ppc64le)
    .include?(node['kernel']['machine'])
end
s390x?(node) click to toggle source

Determine if the current architecture is s390x

@return [Boolean]

# File lib/chef/sugar/architecture.rb, line 131
def s390x?(node)
  %w(s390x)
    .include?(node['kernel']['machine'])
end
sparc?(node) click to toggle source

Determine if the current architecture is SPARC.

@return [Boolean]

# File lib/chef/sugar/architecture.rb, line 69
def sparc?(node)
  %w(sun4u sun4v)
    .include?(node['kernel']['machine'])
end