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

Roles

Let's take another step back and consider what we want to achieve with the roles part of the pattern. The overarching task is to piece together these building-brick-like profile classes into full tech stacks, which we call roles, and are now the second part of our full pattern:

Here you can see that we have taken the composite profiles from our previous example, and stacked them one on top of the other, to produce a full tech stack. We are also utilizing two additional shared profiles:

  • profile::base is included in all machines, including workstations. It manages security baselines and so on, using conditional logic for OS-specific profiles; for example, profile:: base::ubuntu, profile::base::redhat, and so on, as needed.
  • profile::server is included in all machines that provide a service over the network, and configures services such as NTP, firewalls, monitoring, logging, and so on.

Let's look again at the fully functional LAMP stack as an example in Puppet DSL:

# LAMP stack


class role::lamp {
include profile::web::apache
include profile::db::mysql
include profile::programming::php
include profile::server
include profile::base
}
主站蜘蛛池模板: 嘉义县| 胶南市| 萨迦县| 鸡西市| 房山区| 怀安县| 阳东县| 灌南县| 弥渡县| 沭阳县| 吉水县| 荣成市| 蒙山县| 边坝县| 禄丰县| 兴安盟| 甘南县| 大名县| 平乡县| 东丽区| 中宁县| 黔西县| 宁阳县| 武邑县| 班戈县| 武陟县| 婺源县| 黔东| 十堰市| 巢湖市| 库车县| 襄城县| 如皋市| 金川县| 山东省| 武隆县| 沙洋县| 工布江达县| 远安县| 德昌县| 稷山县|