A tiny chef snipped to install gcloud without using a package manager (to get the latest version without waiting)
gcloud_version = node["foo"]["google-cloud-sdk_version"] gcloud_file = "google-cloud-sdk-#{gcloud_version}-linux-x86_64.tar.gz" gcloud_folder = "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads" gcloud_installer = "https://dl.google.com/dl/cloudsdk/channels/rapid/install_google_cloud_sdk.bash" execute "gcloud_install" do # clean up ... download installer but select the version we want ... install ... link command "rm -rf $CLOUDSDK_INSTALL_DIR/google-cloud-sdk && curl #{gcloud_installer} | sed 's;__SDK_URL_DIR=.*;__SDK_URL_DIR=#{gcloud_folder};' | sed 's/__SDK_TGZ=.*/__SDK_TGZ=#{gcloud_file}/' | bash && ln -sf $CLOUDSDK_INSTALL_DIR/google-cloud-sdk/bin/gcloud /usr/local/bin/gcloud" env( "CLOUDSDK_CORE_DISABLE_PROMPTS" => "true", "CLOUDSDK_INSTALL_DIR" => "/opt", # prefix ) not_if { `true && gcloud -v`.include?(gcloud_version) } # ~FC048 end