chef-infratest-kitchen

Error executing action `install` on resource 'windows_feature[AD-Domain-Services]' - on Windows server 2016 chef run with windows_feature resource


error: Error executing action `install` on resource 'windows_feature[AD-Domain-Services]' ^ this happens on all windows features when installing them via windows_feature resource on windows server 2016.

Chef version:

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

And my 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

Solution

  • I was able to get this working by switching out the windows server 2016 vagrant image that I was using for the 100th time...

    The working code looks like:

      [
        '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
    

    and the new image that also works is jacqinthebox/windowsserver2016