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

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.0.0a3-py3-none-win_amd64.whl (5.7 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3musllinux: musl 1.2+ x86-64

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

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

Uploaded Python 3manylinux: glibc 2.17+ x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

steampunk_spotter-6.0.0a3-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.0.0a3-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.0.0a3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a8d7992c3709ae2782bc57560c7ce1bfd25a6e898ef7cfa026810a4fda1d128c
MD5 0295c1b6b38cb8275a7abeac79d0eba2
BLAKE2b-256 a4fd1d426f108a4b84fefcf5094fc413211b0770bcbbac0ecb8277c7ee8cbc4e

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.0.0a3-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.0.0a3-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b0bc50998c3012338d6ba9c63fe1b75c41e285edb74ace4c91f5bac6502ab0ff
MD5 7a8af506b2c765c95c64e2ee52dc2385
BLAKE2b-256 640c18fe3fdca5f2d6caee7a61b57762f865ba79b7db80e5706eb46de478be5f

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.0.0a3-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.0.0a3-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 94c2316a977db164a1b8410b193a14de7a8782336d006e841c575773735f2bca
MD5 e9240e295858fd7b10764be235df2380
BLAKE2b-256 77f94e3745781b1f40455b1579149f1a7e31af7e6beabd28edf6254af8539f0c

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.0.0a3-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.0.0a3-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c01505619c1adcbc8b59965e92b11827af1ddacb00f8fd5116d256af31bdf3fe
MD5 6a8f728e6602d6f46f56625a1e9cd003
BLAKE2b-256 b6cbaade232b3652cc89e545f439151a4f47f67d11ce0c1a133c9fcd4f87d71b

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.0.0a3-py3-none-manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.0.0a3-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 fd96d5b0b4da0eb59eb1b0f70d3d1b9b707c0be5811ddb0fb87ab84ce99f2701
MD5 fbf4991e1ad81d3e14782f0f6a1fce84
BLAKE2b-256 94883563aa00b32bcf654811b1fc498c1e5cd27bd64999ddbcf10eb0372717b9

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.0.0a3-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.0.0a3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 91781fa9bf3e0f7f4ce02a41d281f2d3302792923055136053733520a39c3366
MD5 3a434f4702afe7cc049681cfba0cc890
BLAKE2b-256 1fcda862fa5f7146a363f36868976248f9cf42e60e70f238427d0b2beca1f8f4

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.0.0a3-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.0.0a3-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 14db7947669f7b2b94d3820d92d2643cb5c4492c561ca67c2b6375b25b27199b
MD5 014e06d38362d547a23582586cd61b17
BLAKE2b-256 9398f1ba5eeb79d0894291f74ac87a32f7403e889d1d4abead0762adab0a4bdf

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