因素——版本 3.0.2(提交 5dc120fa9db4c19150466b1bbd1d0cf42c87c6bd)
木偶——版本 4.2.1
以此为例: https ://serverfault.com/questions/471995/how-do-i-check-if-a-user-exists-in-puppet
我遇到了一些似乎并不常见的问题。如果我:
root@puppet manifests]# puppet master --compile cs1.home
Error: Evaluation Error: Unknown variable: '::user_exists_dmadmin'. at /etc/puppetlabs/code/environments/production/manifests/site.pp:28:5 on node cs1.home
从 /etc/puppetlabs/code/environments/production/modules/facts/lib/facter/user_exists_dmadmin.rb
require 'facter'
Facter.add(:user_exists_dmadmin) do
setcode do
name = "dmadmin"
Facter::Util::Resolution.exec("/usr/bin/id -u #{name} 2>/dev/null")
#puts "inside user_exists_dmadmin"
end
end
并且 site.pp 包含
node "cs1.home" {
if ($::user_exists_dmadmin) {
notify {"Documentum Installation Owner exists - NOT making an installation
at this time!" : }
}else
{
notify {"Calling the Documentum Class for installation of Documentum":}
include documentum
}
}
当我编译目录时
[root@puppet production]# puppet master --compile cs1.home
Error: Evaluation Error: Unknown variable: '::user_exists_dmadmin'. at /etc/puppetlabs/code/environments/production/manifests/site.pp:29:6 on node cs1.home
将非常感谢知道错误的原因。
非常感谢
凯文