[英]Puppet fileserver - Could not evaluate
I am working on trying to copying files from my puppetmaster to my webserver, which is not working. 我正在尝试将文件从我的puppetmaster复制到我的网络服务器,这是行不通的。
On my puppetmaster I have edited the file fileserver.conf
and added: 在我的puppetmaster上,我编辑了文件fileserver.conf
并添加:
[extra_files]
path /etc/puppet/files
allow *
After that, restarted puppetmaster and puppet on the puppetmaster. 之后,重新启动puppetmaster和puppetmaster上的puppet。
I have an test.txt in the /etc/puppet/files
folder 我在/etc/puppet/files
夹中有一个test.txt
On the webserver I have this apache2.pp script 在网络服务器上,我有此apache2.pp脚本
file { "/test.txt":
mode => "600",
owner => 'root',
group => 'root',
ensure => present,
source => "puppet:///files/test.txt",
}
I am receiving this error, which I am really unsure how to solve: 我收到此错误,我不确定如何解决:
**Error: /Stage[main]/Main/File[/test.txt]: Could not evaluate: Could not retrieve information from environment production source(s)**
Hope someone can maybe help me with some steps to troubleshoot what is going wrong. 希望有人可以帮助我解决一些问题。
According to description in fileserver.conf
: 根据fileserver.conf
描述:
# [extra_files]
# path /etc/puppet/files
# allow *
#
# In the example above, anything in /etc/puppet/files/<file name> would be
# available to authenticated nodes at puppet:///extra_files/<file name>.
#
change 更改
source => "puppet:///files/test.txt",
to 至
source => "puppet:///extra_files/test.txt",
Don't use file server mounts unless you have a very good reason to do so. 除非有充分的理由,否则不要使用文件服务器挂载。
Instead, create a module that holds the file you need to sync, such as module webserver
而是创建一个包含您需要同步的文件的模块,例如模块webserver
mkdir -p /etc/puppet/modules/webserver/files
In your file
resource, reference the file as follows: 在file
资源中,按如下所示引用文件:
source => 'puppet:///modules/webserver/test.txt'
Be careful not to include files
in the URL of files that are retrieved from within modules. 请注意不要在从模块内部检索到的files
的URL中包含files
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.