2014-09-13 79 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'), {}) 
    

    {}會(正確地)導致無資源的默認結果被創建。