简体   繁体   English

与Puppet无关的订购关系

[英]Ordering relation with no dependency on success with Puppet

Adding a require relation with Puppet means the current resource will be skipped if the required dependencies fails. 使用Puppet添加require关系意味着如果所需的依赖项失败,则将跳过当前资源。

Is it possible to keep the ordering relation but continue the execution even if the dependency failed? 即使依赖项失败,是否可以保留排序关系但继续执行?

Typically, I want to trigger a build after upgrading a package list. 通常,我想在升级软件包列表后触发构建。 If the internet connection is down, the package resource will likely fail but I'd like the build to happen anyway. 如果Internet连接断开,则package资源可能会失败,但是我还是希望构建能够进行。 I initially though that was the point of subscribe , but there doesn't seem to be any difference with require in my case. 我最初虽然是subscribe的要点,但在我的情况下与require似乎没有任何区别。

There is simply no way to do that, and this is against Puppet's design. 根本没有办法做到这一点,这与Puppet的设计背道而驰。

I managed to fix my issue by: 我设法通过以下方式解决了问题:

  • reordering dependencies so there is a single action to do after the soft dependency 重新排序依赖项,因此在依赖项之后只需执行一个操作
  • using the || true 使用|| true || true workaround mentioned on the mailing list . 邮件列表中提到了|| true解决方法。

Edit : In the end, that wasn't really maintainable. 编辑 :最后,那并不是真正可维护的。 Switched to Ansible . 切换到Ansible

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM