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

Uploaded Python 3Windows x86-64

steampunk_spotter-6.1.0a1-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.0a1-py3-none-musllinux_1_2_aarch64.whl (5.0 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

steampunk_spotter-6.1.0a1-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.0a1-py3-none-manylinux_2_17_aarch64.whl (5.0 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

steampunk_spotter-6.1.0a1-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.0a1-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.1.0a1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 70dcd08a9b03ebbe80d3e57b2da3f96cad5e528aae6cd6d200547f1533b94fa1
MD5 2382284fff2291701e1b95490c2b242e
BLAKE2b-256 6aa487c6467c82feccb2f7f8bc63351746a7c291782d631412be6d49f1cad50b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for steampunk_spotter-6.1.0a1-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 30217c27c1b40a67de2e3a4228471a83c5187f3972f93ebb94955b425369ef88
MD5 dd5f754f4b8cb58059676db3f4f94078
BLAKE2b-256 817582d61329da94da8a0a74876c08316673ebc7c66e640fb7a89b5aa2f2d1f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for steampunk_spotter-6.1.0a1-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 060d8d0bb0d7e8f6285d40452f73e95d248e496ceb844a301f5cf7154cfcc834
MD5 db44816b25eb6db4989eb27f54df3b67
BLAKE2b-256 bbd14da3f4d3078490c79966d8669a937374a1d86d74571b20484874efb7d76d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for steampunk_spotter-6.1.0a1-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 61f726fedc07211958bb3eb60794f3258f5812022c760e655c1277958bdb343a
MD5 1991380aec69c90ba910092605720953
BLAKE2b-256 bc46d76c97ef6f77e1dd2fff63751f84dbded10fc7e7f9f57cb2686a26673682

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for steampunk_spotter-6.1.0a1-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 1c93f9b6f6c68ad13a6b94e742f351deaf85d77df8d42773f56c126436714b84
MD5 3e15c0672602fba770987a50555f25da
BLAKE2b-256 66970ac6ad4285aa1c441e9b0782b6c6e77143bb818a9da3e2636dc332665470

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for steampunk_spotter-6.1.0a1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b898843543f62fd5213f8c6f382bff35cf0d463af14b27bc5a8c71296369611e
MD5 3dbcffaa2d5a39c93ece77e65c8bdf58
BLAKE2b-256 252531fce27b24a7eff40c24d27a0a376d8b8162badfb4407a585ff0fa6b76ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for steampunk_spotter-6.1.0a1-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f6103366fa549806149b59be70123a088c343efda5fccb11e52eea10e08bd1d2
MD5 9d2b962d582e73a7f546022bea4dea45
BLAKE2b-256 ebc9e3c398ea787d5b1a7b83e5210dd42b70e44d4da5443c5b79aebdb6af9f19

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