Contents Layout¶
A RackN DRP content pack has the following file system structure.
- A meta.yaml file that defines the meta data of the content pack
- A directory for each type of object in the content pack. e.g. profiles, tasks, templates ...
All of this would live in a single directory for the content.
Example
This is a simple single profile content pack.
content1
content1/profiles
content1/profiles/my-profile.yaml
content1/meta.yaml
content1/._Documentation.meta
content1/README.md
._Documentation.meta is a symbolic link to README.md.
meta.yaml¶
The meta data for a content pack has the following fields:
Example
Author: my name here
CodeSource: https://github.com/changeme
Color: pink
Copyright: Your Copyright here
Description: A short description
DisplayName: Richer name of the content pack
DocUrl: https://github.com/changeme/README.md
Icon: linux
License: Your license here
Name: content1
Order: "100"
Prerequisites: ""
RequiredFeatures: ""
Source: https://github.com/changeme
Tags: tag1,tag2,tag3
The only required fields are the Name field.
The meta data file can also include Version and Documentation but for a normal
filesystem layout these are handled differently.
The Version field is often injected at build time to represent the version of the
content pack by tag or other value.
Version format¶
Version must be a Semantic Versioning 2.0 string: vMAJOR.MINOR.PATCH,
optionally followed by -prerelease and +build. The v is added if missing. Since v4.17.3
every upload validates the whole string; earlier releases checked only the part before the first
-, so a Version that installed before may be rejected now.
Rules that catch date-style versions:
- A numeric identifier cannot have a leading zero.
v26.11.18-013754is rejected withversion segment starts with 0;v26.11.18-t013754is accepted. - Build metadata after
+is accepted but ignored when versions are ordered, so two builds that differ only in+013754and+020000sort as equal. Put a timestamp in the pre-release part. - A pre-release version sorts before the release it names:
v1.2.0-rc1is older thanv1.2.0.
A rejected upload fails with unable to package content archive: <reason>. Fix Version and
rebuild the bundle.
The Documentation field is often stored as a README.md file and imported by creating
a link from ._Documentation.meta to the README.md file. This allows for reading
the documentation from within the change control repository.
Directories for Objects¶
A directory should exist for each DRP object type. The directory contains yaml or json files for
each object of that type. For example, a profile named my-profile would exist in the profiles
directory in a file named, my-profile.yaml. The drpcli contents bundling tools read those files
and generate a single content bundle of those objects.
Note
Templates are special. If the file ends in json, yaml, or yml, the file is assumed to
contain the actual DRP template object. If the file ending is something else, the bundling
tools assume the contents are the contents to put into a template object. The name of
the template will be the filename. A common naming convention is to use base-name.type.tmpl.
- base-name - A name that describes what the template is
- type - The type of file, e.g sh, py, json
- tmpl - The string
tmplto indicate that the file is a template in golang format.
Example
- name-system.sh.tmpl - Bash script that sets the name of the system
- phone-home.py.tmpl - Pyhton script to phone home
Manual Bundling¶
Using the drpcli contents bundle command, you can build a content pack manually.
Once bunlded, the content pack can be uploaded to a DRP endpoint.
These can also be added into catalogs and used by managers to deploy automatically to endpoints.