2016-07-14 34 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语句解决了这个问题。