2016-07-14 60 views
0

我試圖實現清單中定義的步驟的「從上到下」執行。傀儡清單排序因故障週期而失敗

define ui_deploy::ui_deploy_manifest($deploy_params, $params) { 

$version = $deploy_params['version'] 
$install_dir = $deploy_params['install_dir'] 

file { "$install_dir/unzip-ui.ps1": 
    ensure => present, 
    content => template('ui_deploy/unzip.erb') 
} 

exec { "unzip_ui": 
    path => 'C:\Windows\System32\WindowsPowerShell\v1.0', 
    command => "powershell -executionpolicy remotesigned -file ${install_dir}/unzip-ui.ps1", 
    require => File["$install_dir/unzip-ui.ps1"], 
    logoutput => true 
} 

file { "thirdparties": 
    path => 'D:\teamdeploy_install_dir\ui', 
    source => 'D:\teamdeploy_install_dir\thirdp', 
    recurse => true, 
    require => [ 
       Exec["unzip_ui"], 
       Anchor["after-com.team.project.project-thirdparty"], 
       ] 
} 

file { "$install_dir/msbuild.bat": 
    ensure => present, 
    content => template('ui_deploy/msbuild.erb'), 
    require => File["thirdparties"] 
} 

exec { "run_msbuild": 
    command => "cmd.exe /c ${install_dir}\\msbuild.bat", 
    path => $path, 
    require => File["$install_dir/msbuild.bat"], 
    logoutput => true 
}} 

在它失敗

木偶清單解析(ERR):無法適用完整目錄:找到1只依賴循環: (執行[unzip_ui] =>文件[thirdparties] =>文件[D:\ teamdeploy_install_dir \ ui/unzip-ui.ps1] =>執行[unzip_ui])

我真的無法理解這裏的循環在哪裏。從我的角度來看,它是依賴鏈而不是循環。請告訴我我在哪裏錯了。 我也嘗試在'before'語句上重寫它,但結果是一樣的。

+0

'Anchor [「after-com.team.project.project-thirdparty」]「似乎是違規參數。測試刪除它,讓我知道發生了什麼。 –

+0

您提供的代碼不能解釋週期。具體來說,它不解釋表達爲'File [thirdparties] =>文件[D:\ teamdeploy_install_dir \ ui/unzip-ui.ps1]'的依賴關係。如果您提供的內容實際上是問題中涉及的資源聲明的位置,則可以通過其他方式聲明一個或多個其他關係 - 通過範圍內的資源默認值或通過基於收集器的資源覆蓋。 –

+0

還要注意,問題似乎是在目錄應用程序中檢測到的,而不是清單解析(又名目錄編譯)。 –

回答

0

重寫notify => subscribe語句解決了這個問題。