无法调用嵌套的自定义模块 - “找不到类”错误

时间:2017-02-19 05:06:06

标签: puppet

我创建了一个自定义模块,我想将它保存在子目录(类别)中,因为有几个组件应该逻辑上属于该类别。因此,为了更好地隔离事物,我创建了以下结构。

- hieradata
- manifests
- modules
    - infra
        - git
            - files
            - manifests
                - init.pp
                - install.pp
                - configure.pp
        - monitoring
        - etc
- templates

$ cat modules/infra/git/manifests/init.pp
class infra::git {}

$ cat modules/infra/git/manifests/install.pp
class infra::git::install {
    file { 'Install Git':
        ...
        ...
    }
}

$ cat manifests/site.pp
node abc.com {
    include infra::git::install
}

现在在木偶代理上,当我尝试puppet agent -t时,我收到以下错误:

ruby 2.1.8p440 (2015-12-16 revision 53160) [x64-mingw32]

C:\puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: {"message":"Server Error: Evaluation Error: Error while evaluating a Function Call, Could not find class ::infra::git::install for abc.com at /etc/puppetlabs/code/environments/production/manifests/site.pp:15:2 on node abc.com","issue_kind":"RUNTIME_ERROR"}
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

我已经阅读了this链接,但是建议在主modules目录下直接保留自定义模块 ,这不是我想要构建目录的方式。

真的很感激任何帮助。

0 个答案:

没有答案