Chef - 从映射驱动器安装 Windows 包
Chef - Installing a Windows Package from a Mapped Drive
我正在尝试从映射驱动器安装包。然而,厨师说我的源路径是一个无效的位置,即使我知道它是正确的位置。在 Chef 识别源路径之前,我是否需要先映射驱动器?我在网上看了几个地方,找不到答案。
case node['platform']
when 'windows'
windows_package 'QualysCloudAgent' do
source '\Server#\Location1\Qualys_agent\QualysCloudAgent.exe'
options '-argumentlist "CustomerId={etc...etc...etc..} ActivationId={etc...etc..etc...}"'
installer_type :custom
action :install
end
end
我在 chef 客户端运行时得到的错误是源位置在无效源中,即使我可以通过在服务器本身上键入它来到达源位置。任何帮助,将不胜感激。谢谢你。我收到的错误如下。
* Source for package QualysCloudAgent does not exist
================================================================================
Error executing action `install` on resource 'windows_package[QualysCloudAgent]'
================================================================================
Chef::Exceptions::Package
-------------------------
Source for package QualysCloudAgent does not exist
Resource Declaration:
---------------------
# In c:/chef/cache/cookbooks/qualys/recipes/qualys_configure.rb
18: windows_package 'QualysCloudAgent' do
19: source '\Server#\Location1\Qualys_agent\QualysCloudAgent.exe'
20: options '-argumentlist "CustomerId={etc...etc...etc...} ActivationId={etc...etc...etc...}"'
21: installer_type :custom
22: action :install
23: end
24: end
Compiled Resource:
------------------
# Declared in c:/chef/cache/cookbooks/qualys/recipes/qualys_configure.rb:18:in `from_file'
windows_package("QualysCloudAgent") do
package_name "QualysCloudAgent"
action [:install]
default_guard_interpreter :default
declared_type :windows_package
cookbook_name "qualys"
recipe_name "qualys_configure"
source "p:\Server#\Location1\qualys_agent\qualyscloudagent.exe"
options "-argumentlist \"CustomerId={etc...etc...etc...} ActivationId={etc...etc...etc...}\""
installer_type :custom
end
System Info:
------------
chef_version=14.14.25
platform=windows
platform_version=6.3.9600
ruby=ruby 2.5.7p206 (2019-10-01 revision 67816) [x64-mingw32]
program_name=C:/opscode/chef/bin/chef-client
executable=C:/opscode/chef/bin/chef-client
2020-01-12T22:21:50-08:00] INFO: Running queued delayed notifications before re-raising exception
unning handlers:
2020-01-12T22:21:50-08:00] ERROR: Running exception handlers
unning handlers complete
2020-01-12T22:21:50-08:00] ERROR: Exception handlers complete
hef Client failed. 0 resources updated in 14 seconds
2020-01-12T22:21:51-08:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
2020-01-12T22:21:51-08:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
2020-01-12T22:21:51-08:00] FATAL: Chef::Exceptions::Package: windows_package[QualysCloudAgent] (qualys::qualys_configur
line 18) had an error: Chef::Exceptions::Package: Source for package QualysCloudAgent does not exist
由于您正在安装软件包,因此可以安全地假设您 运行宁 chef-client
具有更高的权限。您映射的任何在资源管理器中可见的网络驱动器将无法在提升的进程中使用。您将需要:
- 使用 UNC 路径代替字母驱动器
- 在 Chef 期间映射驱动器 运行(如果完整的 UNC 路径超过 255 个字符则需要)
如果您选择后一种方法,则可以使用 mount
resource to map a network drive。
我正在尝试从映射驱动器安装包。然而,厨师说我的源路径是一个无效的位置,即使我知道它是正确的位置。在 Chef 识别源路径之前,我是否需要先映射驱动器?我在网上看了几个地方,找不到答案。
case node['platform']
when 'windows'
windows_package 'QualysCloudAgent' do
source '\Server#\Location1\Qualys_agent\QualysCloudAgent.exe'
options '-argumentlist "CustomerId={etc...etc...etc..} ActivationId={etc...etc..etc...}"'
installer_type :custom
action :install
end
end
我在 chef 客户端运行时得到的错误是源位置在无效源中,即使我可以通过在服务器本身上键入它来到达源位置。任何帮助,将不胜感激。谢谢你。我收到的错误如下。
* Source for package QualysCloudAgent does not exist
================================================================================
Error executing action `install` on resource 'windows_package[QualysCloudAgent]'
================================================================================
Chef::Exceptions::Package
-------------------------
Source for package QualysCloudAgent does not exist
Resource Declaration:
---------------------
# In c:/chef/cache/cookbooks/qualys/recipes/qualys_configure.rb
18: windows_package 'QualysCloudAgent' do
19: source '\Server#\Location1\Qualys_agent\QualysCloudAgent.exe'
20: options '-argumentlist "CustomerId={etc...etc...etc...} ActivationId={etc...etc...etc...}"'
21: installer_type :custom
22: action :install
23: end
24: end
Compiled Resource:
------------------
# Declared in c:/chef/cache/cookbooks/qualys/recipes/qualys_configure.rb:18:in `from_file'
windows_package("QualysCloudAgent") do
package_name "QualysCloudAgent"
action [:install]
default_guard_interpreter :default
declared_type :windows_package
cookbook_name "qualys"
recipe_name "qualys_configure"
source "p:\Server#\Location1\qualys_agent\qualyscloudagent.exe"
options "-argumentlist \"CustomerId={etc...etc...etc...} ActivationId={etc...etc...etc...}\""
installer_type :custom
end
System Info:
------------
chef_version=14.14.25
platform=windows
platform_version=6.3.9600
ruby=ruby 2.5.7p206 (2019-10-01 revision 67816) [x64-mingw32]
program_name=C:/opscode/chef/bin/chef-client
executable=C:/opscode/chef/bin/chef-client
2020-01-12T22:21:50-08:00] INFO: Running queued delayed notifications before re-raising exception
unning handlers:
2020-01-12T22:21:50-08:00] ERROR: Running exception handlers
unning handlers complete
2020-01-12T22:21:50-08:00] ERROR: Exception handlers complete
hef Client failed. 0 resources updated in 14 seconds
2020-01-12T22:21:51-08:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
2020-01-12T22:21:51-08:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
2020-01-12T22:21:51-08:00] FATAL: Chef::Exceptions::Package: windows_package[QualysCloudAgent] (qualys::qualys_configur
line 18) had an error: Chef::Exceptions::Package: Source for package QualysCloudAgent does not exist
由于您正在安装软件包,因此可以安全地假设您 运行宁 chef-client
具有更高的权限。您映射的任何在资源管理器中可见的网络驱动器将无法在提升的进程中使用。您将需要:
- 使用 UNC 路径代替字母驱动器
- 在 Chef 期间映射驱动器 运行(如果完整的 UNC 路径超过 255 个字符则需要)
如果您选择后一种方法,则可以使用 mount
resource to map a network drive。