繁体   English   中英

木偶使用希拉与模块

[英]puppet use hiera with module

我将使用来自的人偶绑定模块

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'), {})

{}的默认结果将(正确)导致没有资源被创建。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM