[英]Puppet environment: Parameter source failed on File
I have an issue with retrieving file from puppet agent. 我从人偶代理检索文件时遇到问题。 I'm running puppet master 3.7 version.
我正在运行puppet master 3.7版本。 Here is my structure:
这是我的结构:
.
|-- auth.conf
|-- environments
| |-- dev
| | |-- environment.conf
| | |-- manifests
| | | `-- site.pp
| | `-- modules
| | `-- common
| | |-- files
| | | `-- profile
| | |-- manifests
| | | `-- init.pp
| | `-- staticFiles
| | `-- profile
| |-- prod
| | |-- environment.conf
| | |-- manifests
| | | `-- site.pp
| | `-- modules
| | `-- common
| | `-- manifests
| | `-- init.pp
| `-- uat
| |-- environment.conf
| |-- manifests
| | `-- site.pp
| `-- modules
| `-- common
| `-- manifests
| `-- init.pp
|-- etckeeper-commit-post
|-- etckeeper-commit-pre
|-- fileserver.conf
|-- hieradata
|-- hiera.yaml
|-- manifests
|-- modules
|-- nodes
`-- puppet.conf
My config is with puppet environment prod,uat and dev. 我的配置是在puppet环境prod,uat和dev中进行的。 In dev environment I have:
在开发环境中,我有:
manifest = /etc/puppet/environments/dev/manifests/site.pp
#modulepath = /etc/puppet/environments/dev/modules
modulepath = site:dist:modules:$basemodulepath
In a puppet client conf, I have: environment = dev basemodulepath=/etc/puppet/environments/$environment/modules 在一个client客户端conf中,我有:environment = dev basemodulepath = / etc / puppet / environments / $ environment / modules
Here is my init common puppet module: 这是我的初始化普通人偶模块:
file { "/etc/profile":
ensure => "file",
mode => 644,
owner => "root",
group => "root",
require => Package["tree"],
source => "puppet::///common/profile"
}
On the node I got this error: Error: Failed to apply catalog: Parameter source failed on File[/etc/profile]: Cannot use opaque URLs 'puppet::///common/profile' at /etc/puppet/environments/dev/modules/common/manifests/init.pp:13 Wrapped exception: Cannot use opaque URLs 'puppet::///common/profile' 在节点上,我收到此错误:错误:无法应用目录:文件[/ etc / profile]上的参数源失败:无法在/ etc / puppet / environments /使用不透明的URL'puppet :: /// common / profile' dev / modules / common / manifests / init.pp:13打包的异常:无法使用不透明的URL'puppet :: /// common / profile'
Even if I put source file like: 即使我像这样放置源文件:
"puppet::///common/staticFiles/profile"
"puppet::///common/files/profile"
"puppet::///modules/common/profile"
"puppet::///modules/common/files/profile"
"puppet::///modules/common/staticFiles/profile"
I still got the same issue ! 我仍然遇到同样的问题!
Do anyone know are to solve this issue? 有人知道要解决这个问题吗? I really want to retrieve "profile" file in /etc/puppet/environments/dev/modules/common/files/ directory.
我真的很想在/ etc / puppet / environments / dev / modules / common / files /目录中检索“配置文件”文件。
Here is also my puppet master conf content: 这也是我的木偶大师conf内容:
[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
prerun_command=/etc/puppet/etckeeper-commit-pre
postrun_command=/etc/puppet/etckeeper-commit-post
server = puppetmaster01
certname = puppetmaster01
environment = prod
condir = /etc/puppet
report = true
show_diff = true
trace = true
runinterval=60
environmentpath=$confdir/environments
#basemodulepath = $environmentpath/$environment/modules:/etc/puppet/modules:/usr/share/puppet/modules
[master]
# These are needed when the puppetmaster is run by passenger
# and can safely be removed if webrick is used.
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY
certname = puppetmaster01
#modulepath=$confdir/environments/$environment/modules:$confdir/modules
[agent]
report = true
show_diff = true
The URL 网址
puppet:///modules/common/profile
should work. 应该管用。 Please make sure that directory environments are in fact enabled on the master.
请确保实际上在主数据库上启用了目录环境。
If this keeps failing consistently, please run 如果此操作持续失败,请运行
puppet agent --test --trace --verbose --debug
and paste the output on an appropriate service for review. 并将输出粘贴到适当的服务上以进行检查。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.