木偶使用hiera与模块

时间:2014-09-13 17:23:51

标签: linux bind puppet

我将使用

中的puppet bind模块

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 个答案:

答案 0 :(得分:1)

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

在Hiera中为define个实例创建值的过程分为两个步骤。

  1. 创建数据。你的没事,但关键是误导。
  2. e.g。

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

      {}的默认结果将(正确)导致无法创建资源。

相关问题