1

I have a level of dependency in the order of modules being applied:

class build() {
    # define order
    Class['base'] -> Class['config'] -> Class['app'] -> Class['sso']

    class { 'base' : ... }
    class { 'config' : ... }
    # etc
}

class base::init.pp () {
    class { 'base::prereqs' : ... }
    class { 'base::worker' : 
        require => Class['base::prereqs']
        ... 
    }
}

# etc etc

The error occurs when base::prereqs has:

define base::prereqs::file () { ... }

class base::prereqs () {
    $files = [ 'file_name', ... ]
    base::prereqs::file { $files : }
}

The desired order is base::init --> base::prereqs --> base::worker --> config::init --> config::prepreqs --> config::worker --> app::init ...

However the actual order using a define becomes...

base::init --> base::prereqs (except resources created in the define) --> config::init --> config::prereqs --> ... --> base:prepreqs (resources created by define) --> base::worker

The ordering inside base is consistent but the level above in order does not seem to know that resources have been added inside of prereqs and considers base complete.

Any help?

Puppet v3.6.2 (Puppet Enterprise 3.3.2)

4

1 回答 1

2

排序关系不超越使用includeor的通用类声明class { 'title': }

在您的场景中解决此问题的最简单方法是包含类。

class base {
    contain base::prereqs
    contain base::worker
    Class['base::prereqs'] -> Class['base::worker']
}
于 2015-08-19T17:06:08.100 回答