木偶使用带有模块的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 ]

有什么建议吗?

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

在Hiera中为define实例创建值需要两个步骤。

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

例如

bind_server_confs:
  '/etc/named.conf':
    zones:
      'example.com': ['type master', 'file ]
  1. 使用create_resources函数从散列中创建资源

create_resources('bind::server::conf', hiera('bind_server_confs'), {})

{}的默认结果将(正确地)导致不创建任何资源。

最新更新