2014-09-13 78 views
1

我将用木偶绑定模块从木偶使用hiera与模块

https://github.com/thias/puppet-bind

任何想法,我怎么能在YAML格式使用hiera这个?

我已经尝试在Hiera中使用它,但它不会将值传递给模块。

--- 
classes: 
    - 'bind::server' 

profile::bind::conf: 
    '/etc/named.conf': 
     zones: 
      'example.com': ['type master', 'file ] 

有什么建议吗?

回答

1

参数不能自动绑定到模块的类 - 区域通过define创建。

在Hiera中为define实例创建值是一个两步过程。

  1. 创建数据。你的很好,但关键是误导。

例如

bind_server_confs: 
    '/etc/named.conf': 
    zones: 
     'example.com': ['type master', 'file ] 
  • 从使用create_resources函数散列创建资源。
  • create_resources('bind::server::conf', hiera('bind_server_confs'), {}) 
    

    {}会(正确地)导致无资源的默认结果被创建。