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.
- C++ Primer習(xí)題集(第5版)
- JBoss Weld CDI for Java Platform
- C語言從入門到精通(第4版)
- Mastering Ext JS
- 區(qū)塊鏈技術(shù)與應(yīng)用
- 一塊面包板玩轉(zhuǎn)Arduino編程
- C++20高級編程
- 時(shí)空數(shù)據(jù)建模及其應(yīng)用
- Building Serverless Architectures
- 軟件體系結(jié)構(gòu)
- PHP與MySQL權(quán)威指南
- Mastering Adobe Captivate 7
- Visual Basic語言程序設(shè)計(jì)基礎(chǔ)(第3版)
- 零基礎(chǔ)學(xué)SQL(升級版)
- Getting Started with the Lazarus IDE