无法评估:无法从环境生产源检索信息puppet:///modules/toolchain.



我正试图编写一个简单的资源,将恐怖故事的内容从木偶大师复制到木偶特工。

file { "/usr/local/scaligent/" :
ensure => 'directory',
source => "puppet:///modules/toolchain",
recurse => 'true',
#owner => 'root',
#group => 'root',
#mode => '0755',
}

源是puppet master中的/etc/puppetlabs/code/environments/production/modules/toolchain/,目的地是puppet-agent中的/usr/local/scaligent/。

在傀儡代理中获取以下错误:

[~]$ sudo puppet agent -tv --noop
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Applying configuration version '1600365429'
Error: /Stage[main]/Main/File[/usr/local/scaligent/]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/toolchain
Notice: Applied catalog in 0.04 seconds
[ ~]$

根据Puppet资源类型引用,puppet:URI的形式为

puppet:///modules/<MODULE NAME>/<FILE PATH>

它指的是模块中文件或目录的内容,Puppet将在该模块的files目录中查找它。文件系统路径类似于/etc/puppetlabs/code/environments/production/modules/<MODULE NAME>/files/toolchain

您尝试使用的URIpuppet:///modules/toolchain格式不正确,并且您尝试引用的路径不在任何模块的files/目录中。

将";CCD_ 6";目录中包含资源声明的模块的文件。但是,将File声明放在一个类、一个模块中也是传统的做法,而您还没有这样做。在几乎没有任何情况下,在顶级范围内声明该资源是一种好的方式,就像您所做的那样。

最新更新