これは非常に単純な問題であり、いくつかの提案された解決策を読みましたが、git::config クラスをインポートするために puppet apply を取得できません。これが私のファイル設定です:
nodes.pp 経由で git モジュールをインポートします。
#/etc/puppet/manifests/nodes.pp
node default {
}
include git
site.pp は nodes.pp をインポートします。
#/etc/puppet/manifests/site.pp
import 'nodes.pp'
git モジュールは次のように定義されています。
#/etc/puppet/modules/git/manifests/init.pp
class git {
include git::install
include git::config
}
class git::install{
package {'git': => present }
}
および構成ファイル:
#/etc/puppet/modules/git/manifests/config.pp
define git::config{
[some code here]
}
puppet apply を実行すると、puppet が git::config クラスを見つけられません。
sudo puppet apply --modulepath=/etc/puppet/modules /etc/puppet/manifests/site.pp
Error: Could not find class git::config for xxxx on node xxxx.
元のモジュールは puppetlabs-git (同じフォルダー構造) でしたが、簡略化されたファイル構造 (上記) を使用してエラーを再現しました。
更新 1
上記のタイプミス、git config.pp と init.pp はフォルダー /modules/git/manifests にあり、config.pp ファイルは「define git::config」を読み取ります