Ask Your Question

Modules can be collections of code. What type of code is this?

asked 2015-06-22 23:03:27 -0500

Anthony57 gravatar image

When modules are described as being bundles of code and manifests, what type of code is being mentioned here? Is it the Domain Specific Code? Is it code in repositories for non-infrastructure configuration management (e.g., Java code)?

edit retag flag offensive close merge delete


Can you provide a reference that mentions "modules can be collections of code"? i.e. where have you read it?

giavac gravatar imagegiavac ( 2015-06-23 03:19:29 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-06-23 10:11:05 -0500

Jeremiah Powell gravatar image

By code the Puppet Labs documentation means Puppet DSL and Ruby.

Puppet Module Fundamentals defines a module as:

Modules are self-contained bundles of code and data.

The code is a collection of text documents that control, extend or transform any of the behaviors of the programs that compose an installation of Puppet. Puppet code includes class definitions, defined type definitions and resource declarations. Ruby code includes definitions of functions, native types, providers, facts, rSpec tests and patches.

These text documents in /lib and /manifests are organized by a naming scheme set by the Puppet autoloader. The autoloader is a program that discovers the contents of these documents based on the file name and location.

Templates found in /templates in a module may be considered data. All template languages are programming languages. But templates are normally not the focus of the module's purpose. A module could exist that only distributes templates for other modules to use. But, fundamentally, templates are useless on their own without some resource or function to consume them.

Everything else in the module is some kind of data, mostly files in /files or meta-data.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-06-22 23:03:27 -0500

Seen: 116 times

Last updated: Jun 23 '15