A utility for assembling cloud-init user-data from a repository of templates.
Project description
foostitch
Command-Line Usage
usage: foostitch [option]* [recipe]
-o, --output-file arg filename for output
-c, --configuration-file arg filename for configuration
-t, --template-directory directory with templates
recipe recipe name
Configuration (aka Recipe) File Format
- loads configuration files with the following priority (highest to lowest):
- files specified on the command line
./.foostitch
~/.foostitch
/etc/foostitch
- a JSON file of an object
- if the key is "*"
- the value is an object that is the base context for all recipes
- otherwise
- the key is the name of a recipe
- the value is a recipe
- if the key is "*"
- a recipe is an array
- if the first item is an object, that object overlays the base context for that recipe
- if an item is a string
- if the string begins with "*", the remainder of the string is the name of a recipe to include at this point in the recipe
- otherwise, the string is the filename of a
foostache
template; the filename path is relative to a template directory
- if the item following a string is an object, that object overlays the base context for that item
Template Files
- looks for templates in the following order:
- directories specified on the command line
./.foostitch-templates
~/.foostitch-templates
/etc/foostitch-templates
Configuration File
CONFIG_FILE: {
"*": CONTEXT
RECIPE_NAME: RECIPE
}
RECIPE: [ CONTEXT?, (STEP, CONTEXT?)* ]
STEP:
"*RECIPE_NAME"
"TEMPLATE_FILENAME"
In a configuration file, the "*"
context is the base context for everything contained in the file. ([cfg]
)
In a recipe, if there is an initial context, it is applied to the file context to become the recipe context. ([recipe, cfg]
)
In a step, if there is a context, it is applied to the recipe context to become the step context. ([tmpl, recipe, cfg]
) If the step is an embedded recipe, the step context is applied to each step in the embedded recipe.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file foostitch-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: foostitch-1.1.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b75eed286efb3d0c20e7b3ac54d32a729b9bf0ee3db862b1b0ef5a557c87f8f7 |
|
MD5 | 3e0f63561ec6c67d660c056c0206265a |
|
BLAKE2b-256 | b3cb6640a21abf2a4c16fd0789e9a417d6452e6e14fc24db9805fb5960a36e37 |