我是 Puppet 的新手,正在尝试编写一个基本的清单来开始学习它的来龙去脉。
我正在尝试将自定义事实插入清单,并将其写入文件。我创建的自定义事实在发出命令时显示在列表中facter
,但在应用清单时不显示。我只是尝试在本地运行它,我没有设置 puppetmaster。
有人能帮助我并阐明我可能遗漏的东西吗?
我创造的事实如下:
export FACTER_TEST=helloworld
我的清单如下所示:
file {'/tmp/test1':
ensure => present,
content => "testing - $test - $puppetversion - hello",
}
我应用清单如下:
sudo puppet apply testmanifest.pp
结果是事实上在新创建的文件中只显示为空白。
该文件如下所示:
testing - - 3.7.2 - hello
我的 puppet.conf 如下所示:
[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=/var/lib/puppet/lib/facter
prerun_command=/etc/puppet/etckeeper-commit-pre
postrun_command=/etc/puppet/etckeeper-commit-post
[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