Module: Chef::Sugar::Architecture
Instance Method Summary collapse
-
#_32_bit?(node) ⇒ Boolean
Determine if the current architecture is 32-bit.
-
#_64_bit?(node) ⇒ Boolean
Determine if the current architecture is 64-bit.
-
#i386?(node) ⇒ Boolean
Determine if the current architecture is i386.
-
#intel?(node) ⇒ Boolean
Determine if the current architecture is Intel.
-
#powerpc?(node) ⇒ Boolean
Determine if the current architecture is PowerPC.
-
#ppc64?(node) ⇒ Boolean
Determine if the current architecture is Powerpc64 Big Endian.
-
#ppc64le?(node) ⇒ Boolean
Determine if the current architecture is Powerpc64 Little Endian.
-
#sparc?(node) ⇒ Boolean
Determine if the current architecture is SPARC.
Instance Method Details
#_32_bit?(node) ⇒ Boolean
Make this more than “not 64-bit”
Determine if the current architecture is 32-bit
39 40 41 |
# File 'lib/chef/sugar/architecture.rb', line 39 def _32_bit?(node) !_64_bit?(node) end |
#_64_bit?(node) ⇒ Boolean
Determine if the current architecture is 64-bit
27 28 29 30 |
# File 'lib/chef/sugar/architecture.rb', line 27 def _64_bit?(node) %w(amd64 x86_64 ppc64 ppc64le s390x ia64 sparc64 aarch64 arch64 arm64 sun4v sun4u) .include?(node['kernel']['machine']) || ( node['kernel']['bits'] == '64' ) end |
#i386?(node) ⇒ Boolean
Determine if the current architecture is i386
48 49 50 |
# File 'lib/chef/sugar/architecture.rb', line 48 def i386?(node) _32_bit?(node) && intel?(node) end |
#intel?(node) ⇒ Boolean
Determine if the current architecture is Intel.
57 58 59 60 |
# File 'lib/chef/sugar/architecture.rb', line 57 def intel?(node) %w(i86pc i386 x86_64 amd64 i686) .include?(node['kernel']['machine']) end |
#powerpc?(node) ⇒ Boolean
Determine if the current architecture is PowerPC
97 98 99 100 |
# File 'lib/chef/sugar/architecture.rb', line 97 def powerpc?(node) %w(powerpc) .include?(node['kernel']['machine']) end |
#ppc64?(node) ⇒ Boolean
Determine if the current architecture is Powerpc64 Big Endian
77 78 79 80 |
# File 'lib/chef/sugar/architecture.rb', line 77 def ppc64?(node) %w(ppc64) .include?(node['kernel']['machine']) end |
#ppc64le?(node) ⇒ Boolean
Determine if the current architecture is Powerpc64 Little Endian
87 88 89 90 |
# File 'lib/chef/sugar/architecture.rb', line 87 def ppc64le?(node) %w(ppc64le) .include?(node['kernel']['machine']) end |
#sparc?(node) ⇒ Boolean
Determine if the current architecture is SPARC.
67 68 69 70 |
# File 'lib/chef/sugar/architecture.rb', line 67 def sparc?(node) %w(sun4u sun4v) .include?(node['kernel']['machine']) end |