TSL - The State Library Module
Project description
TSL
TSL - The State Library Module
Maintenance
Developed and maintained by TurtleTraction.
Overview
The State Library aims to provide a way to document state files in a consistant manner, similar to sys.doc
.
By adding the DOC
section below to the top of the states file the following feature are enabled.
- State file overview
- Searchable state file estate
- Automated Variable extraction
- Pillar
- Grains
- Include
#START-DOC
# File_name: state.sls
# Author: XXXXXX
# Description:
# Grains (if applicable):
# Pillars (if applicable):
# Syntax: XXXXXX
#END-DOC
Quickstart
To get started with TSL:
Install the extention on the minion
For Salt onedir package (3006 and up):
sudo salt '<minion>' pip.install saltext.tsl
or
sudo salt-pip install saltext.tsl
For classic Salt package (pre 3006):
sudo pip install saltext.tsl
Test (Listing states for a specific minion included in highstate)
sudo salt '<minion>' tsl.list
Use sys.doc to list all tsl functions
sudo salt '<minion>' sys.doc tsl
For any queries please send an email to info@turtletraction.com
Doc header generator
TSL contains an additional standalone script that is not installed with the extension: tsl-add-header.py. You can use it to automatically add the doc header to any number of sls
files:
python tsl-add-header.py path/to/sls-file-or-directory
For usage details, run the following command:
python tsl-add-header.py --help
Development
To get started with your new project:
# Create a new venv
python3 -m venv env --prompt saltext-tsl
source env/bin/activate
# On mac, you may need to upgrade pip
python -m pip install --upgrade pip
# On WSL or some flavors of linux you may need to install the `enchant`
# library in order to build the docs
sudo apt-get install -y enchant
# Install extension + test/dev/doc dependencies into your environment
python -m pip install -e '.[tests,dev,docs]'
# Run tests!
python -m nox -e tests-3
# skip requirements install for next time
export SKIP_REQUIREMENTS_INSTALL=1
# Build the docs, serve, and view in your web browser:
python -m nox -e docs && (cd docs/_build/html; python -m webbrowser localhost:8000; python -m http.server; cd -)
# Run the example function
salt-call --local tsl.hello
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 Distribution
Built Distribution
Hashes for saltext.tsl-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6071c2a20ff0ae7321577a7ec3878a12fdd3b317e0ae7f4c1b4fc452a93f77d2 |
|
MD5 | 0cc89e1a85e9fa6945af149aa935f97f |
|
BLAKE2b-256 | f4ebe68586c3f0bf931e6b9dcec9b67ab53a4399ff1078d01a39dd6ad665f5d6 |