简体   繁体   English

人偶文件资源无法解析源属性

[英]Puppet file resource not resolving the source attribute

I have started to play with puppet 5 and for some reason the source attribute in the puppet file resource is not working. 我已经开始使用人偶5了,由于某种原因,人偶file资源中的source属性无法正常工作。 I have a simple manifest file in my puppet server which is as follows: 我的人偶服务器中有一个简单的清单文件,如下所示:

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

On the agent, I issue: 关于代理,我发出:

puppet agent -t

which errors out as: 错误如下:

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

The file motd exists on the puppet server in /tmp/ directory motd文件存在于/tmp/目录中的木偶服务器上

Any idea what might be going on here? 知道这里可能会发生什么吗?

If I replace source attribute with content => 'Testing 1 2 3' , the puppet agent -t runs successfully creating a catalogue and I see the file motd on the client with the content Testing 1 2 3 如果我将source属性替换为content => 'Testing 1 2 3' ,则puppet agent -t成功运行,创建了目录,并且在客户端上看到内容为Testing 1 2 3 motd文件

As explained in the docs here , the source attribute refers to a local file, ie local on the Puppet Agent node. 正如文档说明这里source属性指的是本地文件,即在木偶代理节点上本地。

If you wish to source the file from the Puppet Server, it would be best to place the file content in the module's files directory as explained here . 如果您希望将文件从木偶服务器的源,这将是最好的模块的文件目录中的文件内容,说明放置在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM