1

I am trying to use git-bash in win 7 to use the chef omnibus installer. I tried the following:

$ curl -L https://opscode.com/chef/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6506  100  6506    0     0   5957      0  0:00:01  0:00:01 --:--:--  6834
Unable to determine platform version!
Please file a bug report at http://tickets.opscode.com
Project: Chef
Component: Packages
Label: Omnibus
Version:

Please detail your operating system type, version and any other relevant details

How can I fix this?

user1592380
  • 26,587
  • 62
  • 220
  • 414

2 Answers2

2

You might potentially be able to modify the install.sh and then run it locally, or place it on a server of your own and execute it in a similar fashion, but it will need to be modified for the platform and version at the very least. However, according to:

http://wiki.opscode.com/display/chef/Fast+Start+Guide+for+Windows

It looks like you can do this following a different method, it does state the following:

Operating System Chef runs on many popular Unix and Linux platforms as well as Mac OSX and Windows. We will describe how to set up using Windows 2008 R2 as a workstation and a client, but these are general directions that will also apply to Windows 7. These directions are known to not work for Windows Server 2003 or on systems that have spaces in the %HOMEPATH%. For instructions on these, see the workstation installation page or the client installation page for Windows.

I assume that possibly the reason you are looking to execute it with bash is to get a more automated install. If the install script is too difficult to modify you could potentially use something more windows-oriented to automate the install according to the guidelines in that link.

By the way, I tried using the same method as you did and received the same message, looking at install.sh you have these lines:

machine=$(echo -e `uname -m`)

# Retrieve Platform and Platform Version
if [ -f "/etc/lsb-release" ] && grep -q DISTRIB_ID /etc/lsb-release;
then
  platform=$(grep DISTRIB_ID /etc/lsb-release | cut -d "=" -f 2 | tr '[A-Z]' '[a-z]')
  platform_version=$(grep DISTRIB_RELEASE /etc/lsb-release | cut -d "=" -f 2)
elif [ -f "/etc/debian_version" ];
then
  platform="debian"
  platform_version=$(echo -e `cat /etc/debian_version`)
elif [ -f "/etc/redhat-release" ];
then
  platform=$(sed 's/^\(.\+\) release.*/\1/' /etc/redhat-release | tr '[A-Z]' '[a-z]')
  platform_version=$(sed 's/^.\+ release \([.0-9]\+\).*/\1/' /etc/redhat-release)

  # If /etc/redhat-release exists, we act like RHEL by default
  if [ "$platform" = "fedora" ];
  then
    # Change platform version for use below.
    platform_version="6.0"
  fi
  platform="el"
elif [ -f "/etc/system-release" ];
then
  platform=$(sed 's/^\(.\+\) release.\+/\1/' /etc/system-release | tr '[A-Z]' '[a-z]')
  platform_version=$(sed 's/^.\+ release \([.0-9]\+\).*/\1/' /etc/system-release | tr '[A-Z]' '[a-z]')
  # amazon is built off of fedora, so act like RHEL
  if [ "$platform" = "amazon linux ami" ];
  then
    platform="el"
    platform_version="6.0"
  fi
# Apple OS X
elif [ -f "/usr/bin/sw_vers" ];
then
  platform="mac_os_x"
  # Matching the tab-space with sed is error-prone
  platform_version=$(sw_vers | awk '/^ProductVersion:/ { print $2 }')

  major_version=$(echo $platform_version | cut -d. -f1,2)
  case $major_version in
    "10.6") platform_version="10.6" ;;
    "10.7") platform_version="10.7" ;;
    "10.8") platform_version="10.7" ;;
    *) echo "No builds for platform: $major_version"
       report_bug
       exit 1
       ;;
  esac

  # x86_64 Apple hardware often runs 32-bit kernels (see OHAI-63)
  x86_64=$(sysctl -n hw.optional.x86_64)
  if [ $x86_64 -eq 1 ]; then
    machine="x86_64"
  fi
elif [ -f "/etc/release" ];
then
  platform="solaris2"
  machine=$(/usr/bin/uname -p)
  platform_version=$(/usr/bin/uname -r)
elif [ -f "/etc/SuSE-release" ];
then
  if grep -q 'Enterprise' /etc/SuSE-release;
  then
      platform="sles"
      platform_version=$(awk '/^VERSION/ {V = $3}; /^PATCHLEVEL/ {P = $3}; END {print V "." P}' /etc/SuSE-release)
  else
      platform="suse"
      platform_version=$(awk '/^VERSION =/ { print $3 }' /etc/SuSE-release)
  fi
fi

platform="windows"

if [ "x$platform" = "x" ];
then
  echo "Unable to determine platform version!"
  report_bug
  exit 1
fi

# Mangle $platform_version to pull the correct build
# for various platforms
major_version=$(echo $platform_version | cut -d. -f1)
case $platform in
  "el")
    case $major_version in
      "5") platform_version="5" ;;
      "6") platform_version="6" ;;
    esac
    ;;
  "debian")
    case $major_version in
      "5") platform_version="6";;
      "6") platform_version="6";;
    esac
    ;;
esac

if [ "x$platform_version" = "x" ];
then
  echo "Unable to determine platform version!"
  report_bug
  exit 1
fi

if [ $use_shell = 1 ];
then
  shell_filename
else
  case $platform in
    "ubuntu") deb_filename ;;
    "debian") deb_filename ;;
    "el") rpm_filename ;;
    "suse") rpm_filename ;;
    "sles") rpm_filename ;;
    "fedora") rpm_filename ;;
    "solaris2") svr4_filename ;;
    *) shell_filename ;;
  esac
fi

echo "Downloading Chef $version for ${platform}..."

url="https://opscode.com/chef/download?v=${version}&prerelease=${prerelease}&p=${platform}&pv=${platform_version}&m=${machine}"

and the last line there, on line 199 of that install.sh script:

https://opscode.com/chef/download?v=${version}&prerelease=${prerelease}&p=${platform}&pv=${platform_version}&m=${machine}

I could not find a url that would work for windows 7 yet but if there is one, you can plug in the details there and it should at least be able to begin the install.

Matt Mullens
  • 2,206
  • 13
  • 14
  • Thanks for the detailed answer – user1592380 Jun 16 '13 at 18:39
  • 1
    Your welcome. I looked a little further and it does appear they are all MSI's so for windows you can go here too where I'd probably use 2008 as substitute for win7: http://www.opscode.com/chef/install/ – Matt Mullens Jun 16 '13 at 18:45
  • And you can probably automate that by pushing out to the systems that need chef and then running there with msiexec /i path/yourchef.msi or something along those lines. – Matt Mullens Jun 16 '13 at 18:49
  • I will follow investigate your detailed answer further. Could I also ask you to check out: taking a look at http://stackoverflow.com/questions/17119003/how-to-fix-ruby-error-sh-1-make-not-found. This was my original question. The current question is a follow up – user1592380 Jun 16 '13 at 19:04
  • Took a quick glance, I see so it appears you have virtualbox with Windows7 as guest, and that's where the chef issue comes in. If I get some time in the evening this week I'll take a more detailed look. – Matt Mullens Jun 17 '13 at 12:03
  • Thanks , I eventually figured it out. I had the wrong version of chef. I needed version 11.4.2 – user1592380 Jun 17 '13 at 14:59
0

You do not want to use the install.sh script on Windows. Chef publishes Windows packages as an MSI.

sethvargo
  • 24,859
  • 9
  • 79
  • 144