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

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
}
主站蜘蛛池模板: 淮安市| 中江县| 东安县| 浑源县| 静海县| 竹溪县| 建德市| 阳曲县| 昭觉县| 延津县| 家居| 靖西县| 林甸县| 甘孜| 巫溪县| 抚远县| 冕宁县| 鸡东县| 溆浦县| 尼木县| 兴业县| 泊头市| 卫辉市| 泌阳县| 泸定县| 竹北市| 清水河县| 凯里市| 道真| 大足县| 弥勒县| 扎鲁特旗| 涿鹿县| 出国| 长治市| 泸定县| 南岸区| 吉首市| 靖安县| 宁国市| 平湖市|