Module metadata¶
Puppet modules can currently contain a series of Metadata fields that can be used to document them.
| Term | Meaning | Example |
|---|---|---|
| name | A module name | modulename |
| author | A name of a registered user | username |
| description | Description of a module | This is a module. |
| summary | Summary of a module | This summary is longer than the description of the module. |
| license | License of a module | GPL |
| source | Location of the source of a module | git://git.example.com/modulename,git |
| project_page | Project page of a module | http://modules.example.com/modulename |
| version | Version of a module | x.y.z |
| dependency | Version of a module | dependency 'username-othermodulename, 'version' |
Puppet Module Tool¶
When adding a module using the Puppet Module Tool this data is added to the Modulefile file located in the root of the module, for example:
name 'myuser-sudo' author 'bob' description 'bob' source 'bob' summary 'bob' license 'bob' project_page 'bob' version '0.0.1'
When the module is uploaded to the Forge the metadata.json file is generated using the data from the Modulefile.
{
"project_page": "bob",
"description": "bob",
"source": "bob",
"summary": "bob",
"author": "bob",
"dependencies": [
],
"license": "bob",
"version": "0.0.1",
"name": "myuser-sudo",
"checksums": {
"files/sudoers": "71ef10cdf5705d53d30e1081bd796136",
"files/file1": "5149d403009a139c7e085405ef762e1a",
"metadata.json": "2ad727c170b7aeb7641f45ac52483132",
"manifests/init.pp": "de2e9d79d4a1703e4226796f113b1253",
"Modulefile": "aa8b009fba245c77140518e49478ee08",
"files/file2": "3d709e89c8ce201e3c928eb917989aef",
"files/etc/sudoers": "9f95a522f5265b7e7945ff65369acdd2"
},
"types": [
]
}
The checksums and types fields are automatically generated using the checksums of the current files present in the module. The types field is generated if types and/or providers are specified in the module (under lib/). Additional fields called facts and functions should probably also be added to document these artifacts.