官术网_书友最值得收藏!

  • Mastering Puppet 5
  • Ryan Russell Yates Jason Southgate
  • 329字
  • 2021-07-16 17:46:11

Roles and Profiles

The roles and profiles pattern became common knowledge in the Puppet community following Craig Dunn's seminal blog post (https://www.craigdunn.org/2012/05/239/), and has been rapidly taken up by the rest of the community. It's now a widely adopted pattern or best practice. It's a reliable way to build reusable, configurable, and refactorable site-wide configuration code, and it's an approach to dealing with the interfaces of your infrastructure—using the software development paradigms of encapsulation and abstraction.

Before the pattern developed, the Puppet language itself provided just two levels of abstraction, as follows:

But it soon became clear that further intermediate abstraction was needed to break up, restructure, and clarify these two.

Let's consider the overarching task: we want to assign classes (and their corresponding business data) to nodes, and we want to do this in a way that encapsulates and hides complexity away at each stage of this abstraction process: moving from looking at the node in its context within the whole infrastructure, as a software stack, and drilling down into the technology components and their configuration, which comprise elements of that software stack.

I've seen nodes being defined in the very long-hand way, using only these two levels of abstraction. I've also seen other approaches, such as using a Hiera-based micro external node classifier (ENC). I've helped to transition companies to using the roles and profiles pattern, and I've used both the Puppet Enterprise console and Foreman as ENC. I've defined nodes in Puppet code, using Hiera in many ways to assist node classification, and I've even used the PE console API for node classification, so I hope I've picked up a few best practices along the way that I can now pass along to you.

In this chapter, let's look together at the roles and profiles pattern, and how this can help you to manage your infrastructure professionally and achieve our next milestone in Mastering Puppet 5.

主站蜘蛛池模板: 勐海县| 合水县| 保康县| 宾川县| 五常市| 牟定县| 绍兴市| 鹤岗市| 南充市| 无棣县| 苗栗市| 焉耆| 高陵县| 五华县| 西乌| 山西省| 乐昌市| 三都| 合阳县| 庆城县| 清徐县| 滦南县| 舟山市| 惠安县| 资阳市| 治多县| 垣曲县| 鄂温| 股票| 镇远县| 崇礼县| 夏河县| 叙永县| 永城市| 双桥区| 茂名市| 玉环县| 扎兰屯市| 图片| 基隆市| 兰坪|