- Extending Puppet
- Alessandro Franceschi
- 208字
- 2021-07-16 11:32:22
Using Hiera as an ENC
Hiera provides an interesting function called hiera_include
, which allows users to include all the classes defined for a given key.
This, in practice, exploits the Hiera flexibility to provide classes to nodes as an External Node Classifier does.
It's enough to place the following line in our site.pp
file at /etc/puppet/manifests/
:
hiera_include('classes')
Define in our data sources a classes
key with an array of the classes to be included.
In a YAML-based backend, it would look like the following:
--- classes: - apache - mysql - php
This is exactly the same as having some declarations in our site.pp
as follows:
include apache include mysql include php
The classes
key (can have any name, but classes
is a standard de facto) contains an array that is merged along the hierarchy. So we can define in a common.yaml
file the classes that we want to include in all our nodes, and include specific classes for specific servers, adding them to the different layers of our hierarchy.
Along with the hiera-file
backend, this function can help us have a fully Hiera-driven configuration on our Puppet architecture. It is one of the many options we have that will help us glue together the pieces that define and build our infrastructure.
- 操作系統(tǒng)實(shí)用教程(Linux版)
- Windows Server 2012 Hyper-V:Deploying the Hyper-V Enterprise Server Virtualization Platform
- 網(wǎng)絡(luò)操作系統(tǒng):Windows Server 2003管理與應(yīng)用
- Linux網(wǎng)絡(luò)操作系統(tǒng)與實(shí)訓(xùn)(第三版)
- 開源安全運(yùn)維平臺(tái)OSSIM疑難解析:入門篇
- 新手易學(xué):系統(tǒng)安裝與重裝
- 嵌入式操作系統(tǒng)(Linux篇)(微課版)
- Linux自動(dòng)化運(yùn)維:Shell與Ansible(微課版)
- 嵌入式實(shí)時(shí)操作系統(tǒng)μC/OS原理與實(shí)踐
- 突破平面3ds Max動(dòng)畫設(shè)計(jì)與制作
- 完美應(yīng)用RHEL 8
- 一學(xué)就會(huì):Windows Vista應(yīng)用完全自學(xué)手冊
- NetDevOps入門與實(shí)踐
- Windows 7實(shí)戰(zhàn)從入門到精通(超值版)
- Linux操作系統(tǒng)