2016-12-12 5 views
4

내 요리 책을 사용하려면 Windows Server 2012 R2에 WMF5를 설치 한 후 게스트를 다시 시작해야합니다.서버 2012R2에서 재부팅을 사용하면 테스트 키가 다시 시도되지 않습니다.

reboot 'Reboot Windows' do 
    action :nothing 
end 

chocolatey 'DotNet4.5.1' do 
    version '4.5.1.20140606' 
    action :install 
end 

chocolatey 'Powershell' do 
    version '5.0.10586.20161027' 
    action :install 
    options ({ '-ignore-package-exit-codes' => '' }) 
end 

powershell_script 'Reboot if PowerShell v4' do 
    notifies :reboot_now, 'reboot[Reboot Windows]', :immediately 
    only_if { reboot_pending? } 
end 

재부팅이 발생하면 테스트 키친은 다시 수렴하지 않고 종료됩니다. 나 또한 종료 코드를 볼 수 없습니다.

D  [WinRM] Waiting for output... 
D  [WinRM] Processing output 
     - execute the ruby block track-path-Powershell 

    * powershell_script[Reboot if PowerShell v4] action run 
     - execute "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/vagrant/AppData/Local/Temp/chef-script20161212-936-452h54.ps1" 
    * reboot[Reboot Windows] action reboot_now[2016-12-12T15:44:04-05:00] WARN: Rebooting system immediately, requested by 'Reboot Windows' 


     Running handlers: 
     Running handlers complete 
     Chef Client finished, 54/140 resources updated in 02 minutes 46 seconds 
    [2016-12-12T15:44:04-05:00] WARN: Rebooting server at a recipe's request. Details: {:delay_mins=>0, :reason=>"Reboot by Chef", :timestamp=>2016-12-12 15:44:04 -0500, :requested_by=>"Reboot Windows"} 
D  [WinRM] Waiting for output... 
D  [WinRM] Processing output 
D  [WinRM] cleaning up command_id: 737D4041-AE48-4403-ADEC-840D31B1FE0E on shell_id B4370D6D-AE03-46E3-9823-EFB3EF2EA14C 
$$$$$$ DL is deprecated, please use Fiddle 
D  Cleaning up local sandbox in  C:/Users/lsmit648/AppData/Local/Temp/default-windows2012r2min-sandbox-20161212-12432-rf5u0f 
     Finished converging <default-windows2012r2min> (3m19.06s). 
-----> Kitchen is finished. (3m58.02s) 

여기

--- 
driver: 
    name: vagrant 
    provider: virtualbox 
    gui: false 
    box_check_update: true 
    vm_hostname: false 
    communicator: winrm 
    guest: windows 
    customize: 
    natdnshostresolver1: 'on' 
    natdnsproxy1: 'on' 
    usb: 'off' 
    reset_command: "exit 0" 
    username: 'vagrant' 
    password: 'vagrant' 
    winrm: 
    boot_timeout: 600 
    max_tries: 500 

# https://github.com/chef/chef-dk/issues/1009#issuecomment-246875683 
transport: 
    name: winrm 
    username: 'vagrant' 
    password: 'vagrant' 
    elevated: true 

provisioner: 
    name: chef_zero 
    retry_on_exit_code: 
    - [35, 1] 
    max_retries: 5 
    wait_for_retry: 60 
    client_rb: 
    exit_status: :enabled 

verifier: 
    name: inspec 

platforms: 
    - name: windows2012.r2.min 
    transport: 
     port: 5985 
    os_type: windows 
    shell_type: powershell 
    driver: 
     box: windows2012.r2.min 
     box_url: <%= ENV['VAGRANT_BOX_REPOSITORY'] %>/windows2012.r2min.json 
     port: 5985 
     winrm: 
     guest_port: 5985 
     network: 
     - ['forwarded_port', {guest: 3389, host: 9561, id: 'rdp', auto_correct: true}] 
     - ['forwarded_port', {guest: 5985, host: 9571, id: 'winrm', auto_correct: true}] 
suites: 
    - name: default 
    run_list: 
     - recipe[chocolatey::default] 
     - recipe[wmf_5] 
     - recipe[roles_features] 

가 어떻게 그 재부팅 다시 수렴하는 주방 시도를하기 위해 사용하는 종료 코드를 캡처 할 수 있습니다 내 .kitchen.yaml 파일입니다?

답변

2

문제를 파악했습니다.

는 기본적으로 설치되고 있던 요리사 클라이언트는 12.8.1

내가 제대로

을 반환 할 종료 코드에 대한 12.11의 최소 버전이 필요했다