傀儡剂不承认R10K拉到模块

问题描述 投票:1回答:1

请帮我从GitHub配置自定义木偶模块。该模块在主拉到正确的,但没有得到所有代理节点上的认可。

Puppetfile

mod "puppet-lamp",
    :git => "https://github.com/blablabla/puppet_lamp.git",
    :ref => "659fe4056060426d3a1449sdfgbc290571f5714f"

environment.conf

modulepath = modules:$basemodulepath

R10K从GitHub正确地拉动模块

.
└── production
    ├── environment.conf
    ├── modules
    │   └── lamp
    │       └── manifests
    │           ├── apache.pp
    │           └── test.pp
    └── Puppetfile

4 directories, 4 files

apache.pp

class apache {

  package { 'httpd':
    ensure => installed,
  }

  service { 'httpd':
    enable => true,
    ensure => 'running'
  }

}

site.pp

include apache

但是,当我运行代理,没有得到应用!

Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Applying configuration version '1549348460'
Notice: Applied catalog in 0.01 seconds

使用节点定义,没有改变试过...

node 'default' {
  include 'apache'
}

这里采用了最新的傀儡

[root@puppetmaster environments]# puppetserver --version
puppetserver version: 6.2.0

[root@node01 ~]# puppet -V
6.2.0

可能有人请告知我究竟做错了什么?提前致谢!

puppet r10k
1个回答
0
投票

你的类名必​​须与模块名服从自动加载限制相匹配。在你的情况,你有一个名为模块lamp,和你有一个名为类apache。这里更容易的途径就是重命名类lamp,因为它是作为lamp根据你的问题在其他地方引用。

另一个自动加载的限制是你的类名必​​须与模块名称和清单名称相匹配。在这种情况下,你的清单被命名为apache.pp,这意味着随后的类将有两个定义及声明书lamp::apache。这里更容易的途径是从apache.pp重命名舱单init.pp,使类的名字将只需要模块名称相匹配。

鉴于这两个问题的命名空间与你的自动加载,这两个步骤是最容易让你的工作将是:

  • 重命名定义,并引用您的舱单apachelamp(例如class lampinclude lamp)。
  • 重命名apache.pp舱单init.pp

欲了解更多信息,可以咨询为木偶的版本,您正在使用的Puppet documentation

© www.soinside.com 2019 - 2024. All rights reserved.