Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Directory 无法评估:无法从环境生产源检索信息puppet:///modules/toolchain_Directory_Puppet - Fatal编程技术网

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
,格式不正确,并且您尝试引用的路径不在任何模块的
文件/
目录中

将“
工具链
”目录放在包含资源声明的模块文件中是常规的,尽管不是必需的。但是,传统的做法是将
文件
声明放在一个类中,放在一个模块中,而您还没有这样做。在几乎没有任何情况下,在顶级范围内声明该资源是一种很好的方式,正如您所做的那样