0

我知道 Puppet 对使用该函数引用模块模板具有一流的支持,template现在我发现自己试图找到对引用模块文件的支持。无论模块位于何处,我都期待file('foomodule/barfile')甚至file('foomodule/files/barfile')正确引用modules/foomodule/files/barfile,但我似乎被迫提供文件的完全限定路径。

不幸的是,该file函数的参考文档没有提供任何关于如何实现这一点的提示,尽管我假设应该有一些优雅的方式来实现这一点。

4

1 回答 1

0

你是这个意思吗?

file { "some_file" :
   source =>"puppet:///modules/foomodule/barfile",
   owner  => "root",
   .....
}

puppet:///modules检查modulepath (/etc/puppet/module)我的情况。bar 文件将位于

/etc/puppet/module/foomodule/files/barfile
于 2013-09-25T21:26:20.503 回答