你可以传入参数进入木偶像这样…..
class foo ($install_version) } #checkout git branch depending on $install_version }
如果没有传递$ install_version,如何设置$ install_version的默认值?
理想情况下,清单将检查所需的git分支,但是如果没有指定分支,它将检出master分支。
http://docs.puppetlabs.com/guides/parameterized_classes.html
你需要阅读你链接的页面:-)
引用:
您也可以为列表中的任何参数提供默认值:
class webserver( $vhost_dir = '/etc/httpd/conf.d', $packages = 'httpd' ) { ... }
所以,在你的情况下:
class foo ($install_version = 'master') }