目标Windows机器上没有安装Chef客户端

时间:2014-06-03 11:24:11

标签: knife chef chef-windows

我无法理解为什么它不在目标机器上安装客户端 在C盘中,opscode目录不可用,因此客户端未安装在目标节点上。

有些人可以帮助我。

10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 1"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 2"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 3"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 4"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 5"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 6"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 7"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 8"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 9"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 10"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 11"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 12"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 13"
10.233.188.207 Checking for existing directory "C:\chef"...
10.233.188.207 Existing directory found, skipping creation.
10.233.188.207
10.233.188.207 C:\Users\Administrator>(
10.233.188.207 echo.url = WScript.Arguments.Named("url")
10.233.188.207  echo.path = WScript.Arguments.Named("path")
10.233.188.207  echo.proxy = null
10.233.188.207  echo.Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
10.233.188.207  echo.Set wshShell = CreateObject( "WScript.Shell" )
10.233.188.207  echo.Set objUserVariables = wshShell.Environment("USER")
10.233.188.207  echo.
10.233.188.207  echo.'http proxy is optional
10.233.188.207  echo.'attempt to read from HTTP_PROXY env var first
10.233.188.207  echo.On Error Resume Next
10.233.188.207  echo.
10.233.188.207  echo.If NOT (objUserVariables("HTTP_PROXY") = "") Then
10.233.188.207  echo.proxy = objUserVariables("HTTP_PROXY")
10.233.188.207  echo.
10.233.188.207  echo.'fall back to named arg
10.233.188.207  echo.ElseIf NOT (WScript.Arguments.Named("proxy") = "") Then
10.233.188.207  echo.proxy = WScript.Arguments.Named("proxy")
10.233.188.207  echo.End If
10.233.188.207  echo.
10.233.188.207  echo.If NOT isNull(proxy) Then
10.233.188.207  echo.'setProxy method is only available on ServerXMLHTTP 6.0+
10.233.188.207  echo.Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0")
10.233.188.207  echo.objXMLHTTP.setProxy 2, proxy
10.233.188.207  echo.End If
10.233.188.207  echo.
10.233.188.207  echo.On Error Goto 0
10.233.188.207  echo.
10.233.188.207  echo.objXMLHTTP.open "GET", url, false
10.233.188.207  echo.objXMLHTTP.send()
10.233.188.207  echo.If objXMLHTTP.Status = 200 Then
10.233.188.207  echo.Set objADOStream = CreateObject("ADODB.Stream")
10.233.188.207  echo.objADOStream.Open
10.233.188.207  echo.objADOStream.Type = 1
10.233.188.207  echo.objADOStream.Write objXMLHTTP.ResponseBody
10.233.188.207  echo.objADOStream.Position = 0
10.233.188.207  echo.Set objFSO = Createobject("Scripting.FileSystemObject")
10.233.188.207  echo.If objFSO.Fileexists(path) Then objFSO.DeleteFile path
10.233.188.207  echo.Set objFSO = Nothing
10.233.188.207  echo.objADOStream.SaveToFile path
10.233.188.207  echo.objADOStream.Close
10.233.188.207  echo.Set objADOStream = Nothing
10.233.188.207  echo.End if
10.233.188.207  echo.Set objXMLHTTP = Nothing
10.233.188.207 ) 1>C:\chef\wget.vbs
10.233.188.207
10.233.188.207 C:\Users\Administrator>(
10.233.188.207 echo.param(
10.233.188.207  echo.   [String] $remoteUrl,
10.233.188.207  echo.   [String] $localPath
10.233.188.207  echo.)
10.233.188.207  echo.
10.233.188.207  echo.$webClient = new-object System.Net.WebClient;
10.233.188.207  echo.
10.233.188.207  echo.$webClient.DownloadFile($remoteUrl, $localPath);
10.233.188.207 ) 1>C:\chef\wget.ps1
10.233.188.207
10.233.188.207 C:\Users\Administrator>(
10.233.188.207
10.233.188.207
10.233.188.207
10.233.188.207 )
10.233.188.207 Detected Windows Version 6.1 Build 7600
10.233.188.207
10.233.188.207 C:\Users\Administrator>goto Version6.1
10.233.188.207
10.233.188.207 C:\Users\Administrator>goto architecture_select
10.233.188.207
10.233.188.207 C:\Users\Administrator>goto Architecture
10.233.188.207
10.233.188.207 C:\Users\Administrator>goto ArchitectureAMD64
10.233.188.207
10.233.188.207 C:\Users\Administrator>goto install
10.233.188.207 Checking for existing downloaded package at "C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-latest.msi"
10.233.188.207 No existing downloaded packages to delete.
10.233.188.207 Attempting to download client package using cscript...
10.233.188.207
10.233.188.207 C:\Users\Administrator>cscript /nologo C:\chef\wget.vbs /url:"https://www.opscode.com/chef/download?p=windows&pv=2008r2&m=x86_64" /path:"C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-latest.msi"
10.233.188.207 C:\chef\wget.vbs(29, 1) msxml3.dll: The operation timed out
10.233.188.207
10.233.188.207
10.233.188.207 Failed download: download completed, but downloaded file not found
10.233.188.207 Warning: Failed to download "https://www.opscode.com/chef/download?p=windows&pv=2008r2&m=x86_64" to "C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-latest.msi"
10.233.188.207 Warning: Retrying download with PowerShell if available...
10.233.188.207 powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -command "& 'C:\chef\wget.ps1' 'https://www.opscode.com/chef/download?p=windows&pv=2008r2&m=x86_64&DownloadContext=PowerShell' 'C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-latest.msi'"
10.233.188.207 Exception calling "DownloadFile" with "2" argument(s): "The remote server retur
10.233.188.207 ned an error: (407) Proxy Authentication Required."
10.233.188.207 At C:\chef\wget.ps1:8 char:24
10.233.188.207 + $webClient.DownloadFile <<<< ($remoteUrl, $localPath);
10.233.188.207     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
10.233.188.207     + FullyQualifiedErrorId : DotNetMethodException
10.233.188.207
10.233.188.207 Download via PowerShell succeeded.
10.233.188.207 Installing downloaded client package...
10.233.188.207
10.233.188.207 C:\Users\Administrator>msiexec /qn /log "C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-msi1331.log" /i "C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-latest.msi"
10.233.188.207 This installation package could not be opened.  Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package.
10.233.188.207 Chef-client package failed to install with status code 1619.
10.233.188.207

10.233.188.207  echo.10.233.188.207  echo.# Using default node name (fqdn)
10.233.188.207 ) 1>C:\chef\client.rb
10.233.188.207
10.233.188.207 C:\Users\Administrator>(echo.{"run_list":["recipe[notepad]"]}) 1>C:\chef\first-boot.json
10.233.188.207 Starting chef to bootstrap the node...
10.233.188.207
10.233.188.207 C:\Users\Administrator>SET "PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\BMC Software\BBCA\Tuner\System;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\ruby\bin;C:\opscode\chef\bin;C:\opscode\chef\embedded\bin"
10.233.188.207
10.233.188.207 C:\Users\Administrator>chef-client -c c:/chef/client.rb -j c:/chef/first-boot.json -E _default
10.233.188.207 See installation log for additional detail: C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-msi1331.log.
10.233.188.207 'chef-client' is not recognized as an internal or external command,
10.233.188.207 operable program or batch file.

2 个答案:

答案 0 :(得分:2)

请检查其尝试执行chef-client的用户。验证用户是否具有安装chef-client的权限。

答案 1 :(得分:0)

你的问题在这里:

10.233.188.207 Exception calling "DownloadFile" with "2" argument(s): "The remote server retur
10.233.188.207 ned an error: (407) Proxy Authentication Required."

因此,您的代理似乎需要验证。两个选项:

1)您的代理支持基本身份验证(而不仅仅是NTLM),您可以在http://<user>:<password>@<proxy_adress>:<proxy_port形式的代理中设置用户和密码警告:如果您的密码包含特殊字符(如@) ,#,é等)你应该将它们添加为url编码的字符(即:@ =&gt;%40,#=&gt;%23所以在你的密码中,每个特殊字符都有%。见{{3编码它)

2)您在目标节点上遇到NTLM身份验证,运气不好但是:您可以在节点和代理之间使用身份验证代理,例如http://meyerweb.com/eric/tools/dencoder/首先尝试使用简单的导航器进行验证它可以工作,你可能需要调整参数才能工作。

还有一件事:如果您的代理进行SSL拦截,稍后您的证书会有另一个不好的时间,除了您的Windows ca证书存储之外,您还必须将它添加到chef cacert.pem。 对于某些工具(如捆绑),您必须设置SSL_CERT_FILE=c:/chef/embedded/ssl/certs/cacert.pem(调整安装位置的路径)

对于vagrant,它有自己的cacert.pem文件,需要在vagrant安装目录下执行相同的操作,并且vagrant在运行时强制使用此文件,覆盖环境变量。

编辑:(刚看到这个问题很老了,我不确定为什么会找到它,但我提供的信息仍然有效,所以保留原样)