Created
August 3, 2011 10:14
-
-
Save alvarobp/1122327 to your computer and use it in GitHub Desktop.
[Chef] Check node architecture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case node[:languages][:ruby][:host_cpu] | |
when "x86_64" | |
when "i686" | |
end |
Also handy is using #{ 'amd64' if node['kernel']['machine'] == 'x86_64' else 'i386'}
if you were attempting to replicate ${ARCH} as described in many shell scripts when trying to download the right deb/rpm/etc.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the only solution I found when looking for node architecture. I found a better looking solution while testing in chef-shell though. While Ruby will always be on a Chef node (AFAIK) using
node[:kernel][:machine]
provides the same output and is an automatic attribute.