Skip to main content

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]'
pre-commit install --install-hooks

# 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

saltext_tsl-1.4.0.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

saltext.tsl-1.4.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file saltext_tsl-1.4.0.tar.gz.

File metadata

  • Download URL: saltext_tsl-1.4.0.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.14

File hashes

Hashes for saltext_tsl-1.4.0.tar.gz
Algorithm Hash digest
SHA256 77660c3fb0f5ba1da41f25c679b7234bbaec5bcbb3c5a268ab371ff45d211ed2
MD5 08d562d40fa2a4dd943ed52d4b1ea985
BLAKE2b-256 507eb3b37b8e4e7f6935bdd24843e2f350e628138716f51ec48b30428493fdeb

See more details on using hashes here.

File details

Details for the file saltext.tsl-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: saltext.tsl-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.14

File hashes

Hashes for saltext.tsl-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 298e875b7cbfbc56811838e05b9441c91e42b0a1b659dc21df42a37cbc30ed46
MD5 102ec214357527b9d2de5874d6be35ff
BLAKE2b-256 b53b942aef9555298e3bbe41e2d8519f393208a1e189d2c8763a565ff441a1fe

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 files

1.3.1

2 files

1.3.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

0.0.3

2 files

0.0.2

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page