我可以使 Puppet 的模組到檔案映射從模組樹的頂部開始搜尋嗎?

我可以使 Puppet 的模組到檔案映射從模組樹的頂部開始搜尋嗎?

考慮這兩個 Puppet 模組檔:

# File modules/a/manifests/b/c.pp
class a::b::c {
    include b::c
}

# File modules/b/manifests/c.pp
class b::c {
    notify { "In b::c": }
}

看起來,當 Puppet 命中include b::cclass 中的指令時a::b::c,它會透過從當前類別向後查找來搜尋相應的 *.pp 文件,並決定找到位於 的正確文件../../b/c.pp。換句話說,它解析為該語句出現的b::c同一個 *.pp 檔案:include b::cmodules/a/manifests/b/c.pp

我期望它(並希望它)找到並加載文件modules/b/manifests/c.pp。有沒有辦法讓 Puppet 做到這一點?如果不是,在我看來,模組名稱可能不包含任何其他模組名稱,這是一個非常令人驚訝的限制。

答案1

強制其頂部使用 'include ::b::c'

相關內容