Summary
Classes and defined types are the essential tools to create reusable Puppet code. While classes hold resources that must not be repeated in a manifest, the define is capable of managing a distinct set of adapted resources upon every invocation. It does that by leveraging the parameter values it receives. While classes do support parameters as well, there are some caveats to bear in mind.
To use defined types in your manifest, you declare instances just like resources of native types. Classes are mainly used through the include
statement, although there are alternatives such as the class { }
syntax or the contain
function.
There are also some ordering issues with classes that the contain
function can help mitigate.
In theory, classes and defines suffice to build almost all the manifests that you will ever need. In practice, you will want to organize your code into larger structures. The next chapter will show you how to do exactly that, and introduce you to a whole range of useful functionality beyond it.
- Vue.js設計與實現
- The Modern C++ Challenge
- Learning Spring 5.0
- Python機器學習實戰
- Oracle JDeveloper 11gR2 Cookbook
- Haxe Game Development Essentials
- Apache Kafka Quick Start Guide
- Scala程序員面試算法寶典
- 組態軟件技術與應用
- AppInventor實踐教程:Android智能應用開發前傳
- Learning Probabilistic Graphical Models in R
- jQuery炫酷應用實例集錦
- Instant jQuery Boilerplate for Plugins
- Python開發基礎
- Unity Android Game Development by Example Beginner's Guide