简体   繁体   English

木偶-如何定义模块上的代码运行的顺序?

[英]Puppet - How do I define the sequence of when the code on modules are run?

I have several modules that need to run in a specific sequence, how do I specify this ? 我有几个需要按特定顺序运行的模块,如何指定呢? Also how do I specify the sequence of classes and commands inside one module ? 另外,如何在一个模块中指定类和命令的顺序?

Found an answer to this myself 我自己找到了答案

using 运用

require => File['something']

and

require class

Also you can set the sequence using -> For example: 您也可以使用->设置顺序,例如:

node 'example.com' {
  class { 'foo' :
  } ->
  class { 'bar' :
  }
}

class bar will be applied after class foo. class bar将在foo类之后应用。

Notify and subscribe also affect to applying sequence. 通知和订阅也会影响申请顺序。 See http://docs.puppetlabs.com/learning/ordering.html 参见http://docs.puppetlabs.com/learning/ordering.html

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

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