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

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.

主站蜘蛛池模板: 淮北市| 北辰区| 潮安县| 乐至县| 信丰县| 孙吴县| 潞西市| 招远市| 喀喇沁旗| 买车| 阳东县| 霍城县| 深圳市| 贵南县| 桓仁| 郸城县| 黔江区| 德惠市| 綦江县| 清水县| 开鲁县| 崇仁县| 百色市| 马龙县| 调兵山市| 肇庆市| 丹棱县| 韩城市| 谢通门县| 司法| 贵州省| 聂荣县| 玛多县| 云南省| 通渭县| 新龙县| 苍溪县| 潼南县| 定陶县| 永济市| 定兴县|