Skip to main content

Ansible Playbook Platform that scans, analyzes, enhances, and provides insights for your playbooks.

Project description

Steampunk Spotter Command-Line Interface (CLI)

PyPI

Steampunk Spotter is an Ansible Playbook Platform that scans, analyzes, enhances, and provides insights for your playbooks.

The Steampunk Spotter CLI enables the use from the console with the ability to scan Ansible content such as playbooks, roles, collections, or task files.

The following instructions explain how to get started with the Steampunk Spotter CLI to scan Ansible content and get recommendations.

Installation

Steampunk Spotter CLI requires Python 3 and is available as a steampunk-spotter Python package.

$ pip install steampunk-spotter

We recommend installing the package into a clean Python virtual environment.

Usage

After the CLI is installed, you can explore its commands and options by running spotter --help. The --help/-h option is also available for every command.

Limitations

The current release version of Steampunk Spotter contains the following limitations that also apply to the CLI:

  • with the FREE subscription plan, you can perform up to 100 scans/month,
  • with the INDIVIDUAL, TEAM, or ENTERPRISE subscription plan you can perform an unlimited number of scans,
  • for the ENTERPRISE subscription plan, contact us at steampunk@xlab.si to discuss your needs.

Authentication

To use CLI, you have to supply your Steampunk Spotter user account credentials. If you don't have an account, use spotter register command that will direct you to the page where you can create one.

Steampunk Spotter supports two kinds of credentials: 1) API token (can be generated in the user settings within the Spotter App), and 2) username and password.

  • Use --token/-t global option to supply your token credential. Alternatively, set the SPOTTER_TOKEN environment variable to contain the API token.
  • Use --username/-u and --password/-p global options to supply your username and password. Alternatively, set the SPOTTER_USERNAME and SPOTTER_PASSWORD environment variables.
  • You can run spotter <options> login to persist your credentials in the Steampunk Spotter CLI's local storage, where <options> stand for one of the approaches described above.

After that, you can start scanning right away.

Scanning

The CLI spotter scan command is used for scanning Ansible content (playbooks, roles, collections, or task files) and returning the scan results.

Ansible content

The scan command will automatically detect the type of your Ansible content and scan it. Here are some examples of running scans:

# scan playbook
$ spotter scan path/to/playbook.yaml

# scan multiple files at once
$ spotter scan path/to/taskfile.yaml \
               path/to/playbook.yaml \
               path/to/role \
               path/to/collection

# scan any folder that contains Ansible content
$ spotter scan path/to/folder

Selecting the target project

This part is only relevant for users with a TEAM plan or higher.

By default, the scan results are stored in the first project of the user's first organization (in the app).

Users that have multiple organizations or projects in the app can use --project-id option to specify the UUID of an existing target project, where the scan result will be stored.

$ spotter scan --project-id <project-id> .

You can learn your project id by logging into the app, selecting the appropriate organization and navigating to the project's dashboard.

Excluding values

By default, CLI parses full Ansible YAML content with all values from playbooks (e.g., parameter values from Ansible modules, variables from Ansible plays, etc.). With values, we can discover additional tips for improvements. CLI will try to detect and omit any secrets (e.g., passwords, SSH keys, cloud credentials, etc.) from being transmitted. If you want to omit parsing and sending the values, you can use --exclude-values option.

$ spotter scan --exclude-values playbook.yaml

Excluding metadata

By default, CLI collects metadata (i.e., file names, line, and column numbers, YAML markers) from Ansible content. This is needed for enriched user experience in the Spotter App and to get additional tips for improvements. If you want to use metadata just for displaying the scan output, which means that no data about your Ansible content structure is sent to the backend server, you can use --exclude-metadata option.

$ spotter scan --exclude-metadata playbook.yaml

Automated application of suggestions to your code

There is also a --rewrite option that rewrites your files with fixes after scanning. This action will modify your files.

$ spotter scan --rewrite playbook.yaml

Next steps

For more comprehensive usage, issue spotter scan --help. Please refer to Steampunk Spotter Documentation for further instructions.

Acknowledgment

This tool was created by XLAB Steampunk, IT automation specialists and leading experts in building Enterprise Ansible Collections.

Release history Release notifications | RSS feed

This version

6.1.0

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 Distributions

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

steampunk_spotter-6.1.0-py3-none-win_amd64.whl (5.7 MB view details)

Uploaded Python 3Windows x86-64

steampunk_spotter-6.1.0-py3-none-musllinux_1_2_x86_64.whl (5.5 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

steampunk_spotter-6.1.0-py3-none-musllinux_1_2_aarch64.whl (5.0 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

steampunk_spotter-6.1.0-py3-none-manylinux_2_17_x86_64.whl (5.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

steampunk_spotter-6.1.0-py3-none-manylinux_2_17_aarch64.whl (5.0 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

steampunk_spotter-6.1.0-py3-none-macosx_11_0_arm64.whl (5.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

steampunk_spotter-6.1.0-py3-none-macosx_10_9_x86_64.whl (5.6 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

File details

Details for the file steampunk_spotter-6.1.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 dd6b98594c9c15ab243267e7814e06a177a2d56290511494a660fef63f2cc973
MD5 9b810e2fa7b2b1a9fb0ab0a835fcef60
BLAKE2b-256 c9d3f60fb841873f5ed8729a8c67c57a5a532a0f12cb7290198f8f8c21a5a8a3

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.1.0-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.1.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8f9ee218e25c5117e01c72d91bbec1bff25818df6183e1a08b6c439e428769b1
MD5 704617c225307807060dbe60e5f76abd
BLAKE2b-256 7055d9319923bcd0b399c44717d6906391fc9be07484995d1e89158a5605793b

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.1.0-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.1.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 791d529d121dd99381f017526f754bc979563ba105d26b6cfcf087ac8f7d3980
MD5 2c391f26cbbddb64f8089f9c7e487063
BLAKE2b-256 921267666f35b1fd8617d0d7bf6ae106260d84f4eb1bb341728b2f773cf05d73

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.1.0-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.1.0-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 9334323ebd27690c674b304da00eb1d371df8a7a9128411da5a7ad7dfd53d5f1
MD5 d4bb45b5cbcd30d03ed8cf2dc6c8fdb2
BLAKE2b-256 8871e0abddd6119d63b58dabad70d124df3f2948ee2363316a53f02fad584c67

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.1.0-py3-none-manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.1.0-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 e22d9d876960b794ef970c9efbcc8f773e99d19505347150e84de007ffb48263
MD5 71a8b941673ab4a7b561b4a376bf0a6c
BLAKE2b-256 5cccd48c15e627170f3b51788afb506afc56e4284a3e75b4667aaac5cc44b895

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.1.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.1.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f02fa053aeb363700f0f977da9658254101326bb7abdee87677ff0069fb13bfb
MD5 bf2fc0bafb9c4845fc238ea4adcfacec
BLAKE2b-256 2b464f415188f73ca23f478000cc7711bbac54a96f05dc261ccb1992362e7da9

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.1.0-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.1.0-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a9e71798cb5823069a7026cc6ba502a5365e83825a66a26076d0951f45c561da
MD5 c8b8b60bd0fa124ac69867e7ed24cea2
BLAKE2b-256 6c279217cf38e4055bf21689822bba16443386b341dc01153c209c5faf161aeb

See more details on using hashes here.

Supported by

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