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.
-
#aarch64?(node) ⇒ Boolean
Determine if the current architecture is AArch64.
-
#armhf?(node) ⇒ Boolean
Determine if the current architecture is ARM with Hard Float.
-
#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.
-
#s390x?(node) ⇒ Boolean
Determine if the current architecture is s390x.
-
#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
41 42 43 |
# File 'lib/chef/sugar/architecture.rb', line 41 def _32_bit?(node) !_64_bit?(node) end |
#_64_bit?(node) ⇒ Boolean
Determine if the current architecture is 64-bit
29 30 31 32 |
# 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) ⇒ Boolean
Determine if the current architecture is AArch64
120 121 122 123 124 |
# 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) ⇒ Boolean
Determine if the current architecture is ARM with Hard Float
109 110 111 112 113 |
# 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) ⇒ Boolean
Determine if the current architecture is i386
50 51 52 |
# File 'lib/chef/sugar/architecture.rb', line 50 def i386?(node) _32_bit?(node) && intel?(node) end |
#intel?(node) ⇒ Boolean
Determine if the current architecture is Intel.
59 60 61 62 |
# 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) ⇒ Boolean
Determine if the current architecture is PowerPC
99 100 101 102 |
# File 'lib/chef/sugar/architecture.rb', line 99 def powerpc?(node) %w(powerpc) .include?(node['kernel']['machine']) end |
#ppc64?(node) ⇒ Boolean
Determine if the current architecture is Powerpc64 Big Endian
79 80 81 82 |
# File 'lib/chef/sugar/architecture.rb', line 79 def ppc64?(node) %w(ppc64) .include?(node['kernel']['machine']) end |
#ppc64le?(node) ⇒ Boolean
Determine if the current architecture is Powerpc64 Little Endian
89 90 91 92 |
# File 'lib/chef/sugar/architecture.rb', line 89 def ppc64le?(node) %w(ppc64le) .include?(node['kernel']['machine']) end |
#s390x?(node) ⇒ Boolean
Determine if the current architecture is s390x
131 132 133 134 |
# File 'lib/chef/sugar/architecture.rb', line 131 def s390x?(node) %w(s390x) .include?(node['kernel']['machine']) end |
#sparc?(node) ⇒ Boolean
Determine if the current architecture is SPARC.
69 70 71 72 |
# File 'lib/chef/sugar/architecture.rb', line 69 def sparc?(node) %w(sun4u sun4v) .include?(node['kernel']['machine']) end |