Directory 无法评估:无法从环境生产源检索信息puppet:///modules/toolchain
我试图编写一个简单的资源,将一个可怕的故事的内容从傀儡主人复制到傀儡代理Directory 无法评估:无法从环境生产源检索信息puppet:///modules/toolchain,directory,puppet,Directory,Puppet,我试图编写一个简单的资源,将一个可怕的故事的内容从傀儡主人复制到傀儡代理 file { "/usr/local/scaligent/" : ensure => 'directory', source => "puppet:///modules/toolchain", recurse => 'true', #owner => 'root', #group => 'root', #m
file { "/usr/local/scaligent/" :
ensure => 'directory',
source => "puppet:///modules/toolchain",
recurse => 'true',
#owner => 'root',
#group => 'root',
#mode => '0755',
}
源是/etc/puppetlabs/code/environments/production/modules/files/toolchain/in puppet master,目标是/usr/local/scaligent/in puppet agent
file { "/usr/local/scaligent/" :
ensure => 'directory',
source => "puppet:///modules/toolchain",
recurse => 'true',
#owner => 'root',
#group => 'root',
#mode => '0755',
}
在puppet代理中获取以下错误:
[~]$ 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//
它是指模块中文件或目录的内容,Puppet将在该模块的文件
目录中查找它。文件系统路径类似于/etc/puppetlabs/code/environments/production/modules//files/toolchain
您尝试使用的URI,puppet:///modules/toolchain
,格式不正确,并且您尝试引用的路径不在任何模块的文件/
目录中
将“工具链
”目录放在包含资源声明的模块文件中是常规的,尽管不是必需的。但是,传统的做法是将文件声明放在一个类中,放在一个模块中,而您还没有这样做。在几乎没有任何情况下,在顶级范围内声明该资源是一种很好的方式,正如您所做的那样