我在从puppet agent中检索文件时遇到问题。我正在运行puppet master 3.7版本。这是我的结构:
.
|-- 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
我的配置是木偶环境prod,uat和dev。 在开发环境中我有:
manifest = /etc/puppet/environments/dev/manifests/site.pp
#modulepath = /etc/puppet/environments/dev/modules
modulepath = site:dist:modules:$basemodulepath
在木偶客户端conf中,我有: environment = dev basemodulepath =的/ etc /木偶/环境/ $环境/模块
这是我的init常用木偶模块:
file { "/etc/profile":
ensure => "file",
mode => 644,
owner => "root",
group => "root",
require => Package["tree"],
source => "puppet::///common/profile"
}
在节点上我收到此错误: 错误:无法应用目录:文件[/ etc / profile]上的参数源失败:无法在/ etc / puppet / environments / dev / modules / common / manifests /中使用opaque网址'puppet :: /// common / profile' init.pp:13 包装异常: 不能使用不透明网址'puppet :: /// common / profile'
即使我把源文件放在:
"puppet::///common/staticFiles/profile"
"puppet::///common/files/profile"
"puppet::///modules/common/profile"
"puppet::///modules/common/files/profile"
"puppet::///modules/common/staticFiles/profile"
我仍然遇到同样的问题!
有谁知道要解决这个问题? 我真的想在/ etc / puppet / environments / dev / modules / common / files /目录中检索“profile”文件。
这也是我的木偶大师内容:
[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
答案 0 :(得分:0)
网址
puppet:///modules/common/profile
应该有效。请确保主服务器上实际启用了目录环境。
如果这种情况持续失败,请运行
puppet agent --test --trace --verbose --debug
并将输出粘贴到适当的服务上以供审核。