Puppet文件资源无法解析源属性

时间:2017-10-24 00:40:29

标签: puppet centos7

我已经开始使用puppet 5,并且由于某种原因,puppet source资源中的file属性无效。我的puppet服务器中有一个简单的清单文件,如下所示:

file {'/tmp/motd':
  source => '/tmp/motd',
}

在代理上,我发出:

puppet agent -t

出错为:

Error: /Stage[main]/Main/File[/tmp/motd]: Could not evaluate: Could not retrieve information from environment production source(s) file:/tmp/motd

文件motd存在于/tmp/目录

中的puppet服务器上

知道这里可能会发生什么吗?

如果我将source属性替换为content => 'Testing 1 2 3',则puppet agent -t会成功创建目录,并在客户端上看到文件motd,内容为Testing 1 2 3 }

1 个答案:

答案 0 :(得分:0)

如文档here中所述,source属性引用本地文件,即Puppet Agent节点上的本地文件。

如果您希望从Puppet Server获取文件,最好将文件内容放在模块的文件目录中,如here所述。

相关问题