puppet清单文件中的资源/类执行顺序

我在configurationCQ5在stream浪者pipe理的虚拟机上工作。 configuration是使用puppet完成的。 我有查询方面的木偶清单文件中的类/资源的执行顺序。

请在下面find清单文件cqsite.pp

include java include apache cq::instance {myauthor: installation_type => author, } cq::instance {mypublish: installation_type => publish, } 

在提供过程中,puppet最初​​selectcq资源(cq :: instance)而不是java。 但是必须先安装java才能在cq :: instance.pp文件中执行一些命令。 所以它抛出一个错误。 请帮我find解决办法

您没有指定任何资源依赖关系,所以Puppet会以看似随机的顺序应用这些更改。

如果应该在你的cq::instance定义之前安装java类,那么你应该像这样添加一个显式依赖:

 cq::instance { myauthor: installation_type => author, require => Class['java'] } 

甚至:

 Class['java'] -> Cq::Instance <| |> 

请参阅https://docs.puppetlabs.com/puppet/latest/reference/lang_relationships.html