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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3musllinux: musl 1.2+ x86-64

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

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

Uploaded Python 3manylinux: glibc 2.17+ x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

steampunk_spotter-6.2.0rc1-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.2.0rc1-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.2.0rc1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a3559254a514f6c7d39088ee0bb93e23a96a60691212358f19d4dd6d72c69a8b
MD5 6cd311405e5cf26a2adf128711853adb
BLAKE2b-256 2665916ac55b04a9a9d13205c0f2cfd6c10234147d401dcba8e934d4e0aba2fa

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.2.0rc1-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.2.0rc1-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 57d8ca4c2eef0d2408fcfabdc087f1f3aab3988b4f6377d723d9928754d61f82
MD5 672d4eefa424c7257ca58abbe91f9266
BLAKE2b-256 3a6fc86b6d28a5b5fc15f4d33e12379287ee73279e4ae2c79f3581a775c6ef8c

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.2.0rc1-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.2.0rc1-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 a21d01bb43175d1672fe73274e2eae8e563306179b7a5aab94d8eea9bbce1c5a
MD5 f435205f200865bc0f4292f74bd737d5
BLAKE2b-256 e93d480762c3d1c019a60befe3972a1369099fd858f3b750bc9c889799660133

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.2.0rc1-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.2.0rc1-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 443fbae0812bee32ad1a191eb6e8fc7512e9d9eedaf4bacbe916d18653113feb
MD5 1b3148d71559d1ea360aa3ce3dadc644
BLAKE2b-256 eacba9aa92ed570a370b5f6578741be621466c5615d78cd73119968961aca570

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.2.0rc1-py3-none-manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.2.0rc1-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 7a824c9da29837b50cb6e92f9351415327fd126fe155d99c45b635c3d9a4d65b
MD5 db0e5d84398c4220c8b7b9b2f1eab13b
BLAKE2b-256 ca81ba5a3af728cc4b06afe660a4e648061f3a8c41525c9c915ec69900f44672

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.2.0rc1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.2.0rc1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fd746a1bdfe355767e782f9e9c552cd4e5c462c85273934453bcfa7921252f56
MD5 4172117fc5c96cf9b53d60fe9bf40f87
BLAKE2b-256 2d992ebf1374a4e6a48e2c093bdb9441b8a231858c8fc5dddf14233d93c941b7

See more details on using hashes here.

File details

Details for the file steampunk_spotter-6.2.0rc1-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for steampunk_spotter-6.2.0rc1-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 efc098424c0113052508455257128d96388b0aca436958d94c4fff9d2cf3f7cc
MD5 1d2f5dc788e4011fa272c1cf38fbf3b6
BLAKE2b-256 f7a576fe8526f24b2a7eea644e30cf073e7ba2752e776c2e66c9e76feaa96469

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