Puppet -->Language: Basics
Language: BasicsPuppet uses its own configuration language, which was designed to be accessible to
Puppet用它自己的配置语言,系统管理员可以很轻松的接触该配置语言。
sysadmins. The Puppet language does not require much formal programming experience and
Puppet语言不需要很多正式的编程经验,
its syntax was inspired by the Nagios configuration file format.
同时它的语法受Nagios的配置文件的格式的影响。
Resources,> 资源,类和节点
The core of the Puppet language is declaring resources. Every other part of the language
Puppet语言的核心是声明资源。Puppet语言的其他部分是为了
exists to add flexibility and convenience to the way resources are declared.
增加声明资源的灵活性和方便性
Groups of resources can be organized into classes, which are larger units of configuration.
一组资源可以被放在类里面,类是比资源更大的一个配置单元。
While a resource may describe a single file or package, a> 然而,一个资源可能描述一个单一的文件或者程序包,一个类可能描述
needed to configure an entire service or application (including any number of packages, config
配置完整的服务或者应用所需的所有配置(包括所有的程序包,配置文件,
files, service daemons, and maintenance tasks). Smaller> 服务守护进程和维护任务)。小点的类会和大点的类结合,大点的类描述完整的自定义系统角色
larger> ,比如数据库服务或者web应用工作
application worker.”
Nodes that serve different roles will generally get different sets of> 不同的节点会得到不同的类的集合以适应不同的角色。
configuring which> 配置哪些类将被应用到一个特定的节点的工作被称作节点分类。
can be> 在Puppet语言中可以用节点定义来对节点进行分类;也可以从你的外部清单用详细的节点数据
using node-specific data from outside your manifests, such as that from an ENC or Hiera.
比如从ENC或者Hiera。
未完待续......
https://docs.puppet.com/puppet/latest/reference/lang_summary.html
页:
[1]