Chef-从映射的驱动器安装Windows软件包

问题描述 投票:0回答:1

我正在尝试从映射的驱动器安装软件包。但是,厨师说我的源路径是无效的位置,即使我知道这是正确的位置。在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

即使当我可以通过在服务器本身上键入来到达源位置时,厨师客户机运行时出现的错误是源位置在无效源中。任何帮助,将不胜感激。谢谢。我收到的错误如下。


   * 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

windows powershell chef
1个回答
1
投票

由于正在安装软件包,因此可以安全地假设您以提升的权限运行chef-client。在资源管理器中可见的您映射的任何网络驱动器在提升的过程中将无法使用。您将需要:

  • 使用UNC路径代替字母驱动器
  • 在Chef运行期间映射驱动器(如果完整的UNC路径超过255个字符,则是必需的)

如果选择后一种方法,则可以使用mount resourcemount

© www.soinside.com 2019 - 2024. All rights reserved.