【问题标题】:Error executing action `install` on resource 'windows_feature[AD-Domain-Services]' - on Windows server 2016 chef run with windows_feature resource在资源“windows_feature [AD-Domain-Services]”上执行操作“安装”时出错 - 在 Windows Server 2016 Chef 上使用 windows_feature 资源运行
【发布时间】:2018-11-29 00:59:48
【问题描述】:

错误:Error executing action `install` on resource 'windows_feature[AD-Domain-Services]' ^ 在 Windows Server 2016 上通过 windows_feature 资源安装所有 Windows 功能时,都会发生这种情况。

厨师版:

Chef Development Kit Version: 3.2.30
chef-client version: 14.4.56
delivery version: master (6862f27aba89109a9630f0b6c6798efec56b4efe)
berks version: 7.0.6
kitchen version: 1.23.2
inspec version: 2.2.70

还有我的 kitchen.yml:

driver:
  name: vagrant
  boot_timeout: 600
provisioner:
  name: chef_solo
#  name: chef_zero
#  require_chef_omnibus: 14.6.47
  retry_on_exit_code:
    - 35
  max_retries: 3
  multiple_converge: 3
  wait_for_retry: 600
platforms:
  - name: windows2012r2
    driver:
      box: mwrock/Windows2016
      box_url: mwrock/Windows2016
suites:
  - name: default
    run_list:
      - recipe[windows_ad::default]
#      - recipe[windows_ad::configure_domain]
    retry_on_exit_code:
    - 35
    max_retries: 3
    multiple_converge: 3
    wait_for_retry: 600

【问题讨论】:

    标签: chef-infra test-kitchen


    【解决方案1】:

    这是我们用来安装一系列 Windows 功能的一些工作代码:

    features = ['Web-WebServer',                    # Web Server
                'Web-Windows-Auth',                 # Windows Authentication
                'Web-Mgmt-Tools',                   # Management Tools
                'Web-WMI',                          # IIS 6 WMI Compatibility
                'Web-Mgmt-Compat',                  # IIS 6 Management Compatibility
                'NET-Framework-Features',           # .NET Framework 3.5 Features
                'NET-Framework-45-Features',        # .NET Framework 4.5 Features
                'NET-WCF-Services45']               # WCF Services
    
    windows_feature 'Install App Server Features' do
      feature_name features
      action :install
      install_method :windows_feature_powershell
      source node['windows_feature_source']
    end
    

    您会注意到,我们还为 Windows 功能指定了source(从我们设置的属性中读取),因为我们从服务器中剥离了源代码,而是指向远程文件共享 - 这可能是您遇到的问题有。如果您知道源文件在服务器上,您也可以删除 source 属性。

    【讨论】:

      【解决方案2】:

      我可以通过切换我第 100 次使用的 windows server 2016 vagrant 图像来完成这项工作...

      工作代码如下:

        [
          'AD-Domain-Services',
          'DNS',
          'FileAndStorage-Services',
          'File-Services',
           ....
           ....
        ].each do |feature|
          windows_feature feature do
            action :install
            install_method :windows_feature_powershell
            all true
          end
        end
      else
        [
          'NetFx3',
          'Microsoft-Windows-GroupPolicy-ServerAdminTools-Update',
          'DirectoryServices-DomainController'
        ].each do |feature|
          windows_feature feature do
            action :install
            install_method :windows_feature_powershell
          end
        end
      end
      

      同样有效的新图片是jacqinthebox/windowsserver2016

      【讨论】:

        猜你喜欢
        • 2019-01-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多