gpt4 book ai didi

provisioning - Puppet Nodes.pp 包含模块执行顺序

转载 作者:行者123 更新时间:2023-12-04 04:44:38 24 4
gpt4 key购买 nike

我正在尝试为某些节点在我的某些模块上设置顺序。

node basenode{
include ps
include netfx
include hg
include reportviewer2012
include wdeploy30
include sqlexpress2008
include windowsrolesfeatures
include tcbase
}

node 'myserver' inherits basenode {
include tcuiagent

Class['tcuiagent'] -> Class['tcbase'] -> Class['windowsrolesfeatures'] -> Class['ps']
}

当然,我不想在模块资源中设置依赖关系,因为这会使它们相互依赖,而我不想这样做。在这种情况下,我想完成这个命令。
  • ps(第一个)
  • windows角色功能
  • anyotherpackage {hg,netfx...}(不关心配置顺序)
    n. tcbase
  • tcuigant(最后一个)
  • 最佳答案

    如果你真的不想表达模块之间的关系,你可以使用阶段来强制执行命令。

    您必须首先在顶级 list 中声明阶段:

    ## Very important : we define stages.
    ## Can only be done here.
    stage { 'first': } # the first of first
    stage { 'apt': } # to install apt sources and run apt-get update if necessary
    # stage main # default stage, always available
    stage { 'last': } # a stage after all the others
    # Now we define the order :
    Stage[first] -> Stage[apt] -> Stage[main] -> Stage[last]

    然后使用它们:

    # basics needing a run state
    # We use the "class" syntax here because we need to specify a run stage.
    class
    {
    'puppeted': # debug
    stage => first, # note the explicit stage !
    ;
    'apt_powered': # Very important for managing apt sources
    stage => apt, # note the explicit stage !
    #offline => 'true', # uncomment this if you are offline or don't want updates
    ;
    'apt_powered::upgraded': # will systematically upgrade paquets. dev machine -> we want to stay up to date
    stage => apt, # note the explicit stage !
    ;
    }

    但这很丑陋,这不是阶段的目的。

    关于provisioning - Puppet Nodes.pp 包含模块执行顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12826301/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com