我尝试包含模块文档在我的Foreman/Puppet
系统上。我克隆了 git 并将内容移动到 modules-path /etc/puppet/environments/production/modules
。
如果我将模块分配给主机,则会收到此错误:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class docsf for example.com on node example.com .
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
这是文件树(/etc/puppet/environments/production/modules
):
docsf/
├── lib
│ └── facter
│ └── configserver_firewall.rb
├── LICENSE
├── manifests
│ ├── init.pp
│ ├── params.pp
│ ├── postinit.pp
│ └── preinit.pp
├── metadata.json
├── README.md
├── spec
│ └── spec_helper.rb
├── templates
│ ├── conf.maldet.erb
│ ├── csf.allow.erb
│ ├── csf.conf.erb
│ ├── csf.fignore.erb
│ ├── csf.ignore.erb
│ └── csf.pignore.erb
└── tests
└── init.pp
这是具有权限的文件树:
[root@puppet modules]# tree -p -u -g docsf/
docsf/
├── [drwxr-xr-x puppet root ] lib
│ └── [drwxr-xr-x puppet root ] facter
│ └── [-rw-r--r-- puppet root ] configserver_firewall.rb
├── [-rw-r--r-- puppet root ] LICENSE
├── [drwxr-xr-x puppet root ] manifests
│ ├── [-rw-r--r-- puppet root ] init.pp
│ ├── [-rw-r--r-- puppet root ] params.pp
│ ├── [-rw-r--r-- puppet root ] postinit.pp
│ └── [-rw-r--r-- puppet root ] preinit.pp
├── [-rw-r--r-- puppet root ] metadata.json
├── [-rw-r--r-- puppet root ] README.md
├── [drwxr-xr-x puppet root ] spec
│ └── [-rw-r--r-- puppet root ] spec_helper.rb
├── [drwxr-xr-x puppet root ] templates
│ ├── [-rw-r--r-- puppet root ] conf.maldet.erb
│ ├── [-rw-r--r-- puppet root ] csf.allow.erb
│ ├── [-rw-r--r-- puppet root ] csf.conf.erb
│ ├── [-rw-r--r-- puppet root ] csf.fignore.erb
│ ├── [-rw-r--r-- puppet root ] csf.ignore.erb
│ └── [-rw-r--r-- puppet root ] csf.pignore.erb
└── [drwxr-xr-x puppet root ] tests
└── [-rw-r--r-- puppet root ] init.pp
答案1
请生成以下输出:
cat docsf/manifests/init.pp
确保内容看起来像这样:
class docsf{
#ClassContent
}