-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathch04-Writing_Better_Manifests.txt
57 lines (38 loc) · 1.67 KB
/
ch04-Writing_Better_Manifests.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
[[chapter04]]
== 书写更优质的配置清单
[quote, Bjarne Stroustrup,]
There are only two kinds of programming languages: those people always bitch
about and those nobody uses.
在本章中,我们将学习如下内容:
- {Recipe401}
- {Recipe402}
- {Recipe403}
- {Recipe404}
- {Recipe405}
- {Recipe406}
- {Recipe407}
- {Recipe408}
- {Recipe409}
- {Recipe410}
- {Recipe411}
你的 Puppet 配置清单实际上就是你所管理的整个基础设施的活生生的文档。
保持配置清单的整洁和良好组织使其更容易维护和理解是个明智之举。
Puppet 为你方便管理代码提供了许多工具,其中包括:
- 数组(Arrays)
- 定义(Defines)
- 依赖(Dependencies)
- 继承(Inheritance)
- 类参数(Class parameters)
我们将看到如何使用上面的所有工具(甚至更多)。通过对本章的阅读,尝试使用这些例子做实验,
看看利用这些功能是否能帮你简化和改善你的 Puppet 代码。
include::recipes/ch04sec01-using_arrays_of_resources.txt[]
include::recipes/ch04sec02-using_define_resources.txt[]
include::recipes/ch04sec03-using_dependencies.txt[]
include::recipes/ch04sec04-using_node_inheritance.txt[]
include::recipes/ch04sec05-using_class_inheritance_and_overriding.txt[]
include::recipes/ch04sec06-passing_parameters_to_classes.txt[]
include::recipes/ch04sec07-writing_reusable_cross-platform_manifests.txt[]
include::recipes/ch04sec08-getting_information_from_the_environment.txt[]
include::recipes/ch04sec09-importing_dynamic_information.txt[]
include::recipes/ch04sec10-importing_data_from_csv_files.txt[]
include::recipes/ch04sec11-passing_arguments_to_shell_commands.txt[]