我發現的問題是我可以成功安裝Puppet模塊。例如:Puppet找不到我剛剛安裝的模塊
[[email protected] ~]$ puppet module install puppetlabs/mysql
Notice: Preparing to install into /home/puppet/.puppet/modules ...
Notice: Created target directory /home/puppet/.puppet/modules
Notice: Downloading from https://forge.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/home/puppet/.puppet/modules
└─┬ puppetlabs-mysql (v2.1.0)
└── puppetlabs-stdlib (v4.1.0)
但是當我嘗試使用nodes.pp文件中像這樣調用模塊:
node 'example.com' {
include '::mysql::server'
}
然後我得到一個錯誤這樣的:
[[email protected] mysql]$ sudo puppet apply ~puppet/puppet/manifests/site.pp
Error: Could not find class ::mysql::server for example.com on node example.com
Error: Could not find class ::mysql::server for example.com on node example.com
如何我可以修復它嗎?
我嘗試使用puppetlabs/postgresql模塊時遇到了同樣的問題,並且使用'sudo puppet module install -i/etc/puppet/modules puppetlabs/postgresql'完成了這個任務。 –