在我的木偶模塊,我有這樣的事情:傀儡木偶聯模板:// URL中
file {'myfile':
ensure => 'file',
path => '/whatever/myfile',
content => inline_template(file(
"puppet:///modules/my_module/templates/${domain}/${::hostname}_myfile.erb",
"puppet:///modules/my_module/templates/${domain}/myfile.erb"
))
}
而且我的規格看起來像:
require 'spec_helper'
describe 'my_module' do
context 'with defaults for all parameters' do
it { should compile }
end
end
如果嘗試運行它,我得到:
Failure/Error: it { should compile }
error during compilation: Evaluation Error: Error while evaluating a Function Call, Could not find any files from puppet:///modules/my_module/templates/dev.contaazul.local/myfile.erb, puppet:///modules/my_module/templates/dev.contaazul.local/myfile.erb at /home/carlos/Code/Puppet/modules/my_module/spec/fixtures/modules/my_module/manifests/init.pp:48:33 on node becker.local
顯然,它找不到任何ERB模板。如果我將puppet://
部分替換爲/home/carlos/Code/Puppet/
(代碼實際在其中),它會通過,但在生產中它是/etc/puppet/
,因此它不起作用。
我該如何做這項工作?
工作,非常感謝! – caarlos0