没有模块的木偶模板

Eri*_*ner 5 puppet

我想在没有 puppetmaster 的情况下使用 puppet,并使用 git push 工作流应用清单。我想避免将所有内容分成模块,因为服务器配置不是很复杂。但是,该template()函数在访问不在模块中的模板时似乎存在问题。

如果清单位于<puppet-root>/manifests/site.pp我如何引用例如<puppet-root>/templates/sshd_config.erb

Chr*_*aro 0

在 puppet root 中有一个 templates 目录应该可以工作,请尝试以下操作:

file { '/tmp/testfile':
    content => template('puppet:///templates/testfile.erb'),
}
Run Code Online (Sandbox Code Playgroud)