npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ansibler

v0.0.1

Published

Performs various tasks required for generating sleek documentation for Ansible playbooks and roles

Downloads

2

Readme

Performs various tasks required for generating sleek documentation for Ansible playbooks and roles

-----------------------------------------------------

➤ Table of Contents

-----------------------------------------------------

➤ Requirements

-----------------------------------------------------

➤ Overview

Ansibler is a set of tools used to manage Ansible playbooks and roles. It provides the following functionality:

-----------------------------------------------------

➤ Getting Started

You can run ansibler by installing it globally (i.e. npm install -g @megabytelabs/ansibler) or running it with npx. You can then run ansibler --help to see the available parameters. You should see output that looks something like this:

❯ ansibler --help
Usage: ansibler [options]

-h, --help Displays help
-d, --data String Relative path to the data file.
-o, --output String Relative path to the output file - default: ./ansible-molecule.json
-c, --command String Additional commands to run before analyzing
-i, --inject String Inject output to a JSON file

-----------------------------------------------------

➤ Example Usage

Ansibler has several different features that can be individually run or run all at the same time.

Populating the Role Dependency Chart for the Main Playbook

To generate the role dependency chart (that you can see in the README of our Playr repository), you should:

  1. Make sure all the roles are located in the roles/ folder of your project and that each role has a valid description.
  2. Run ansibler --roles "./roles" --output "./role-chart.json" --populate-descriptions

The command above will scan through the roles/ folder and extract all of the descriptions into a JSON file. It might be important to know that a special format is used that is meant to be compatible with @appnest/readme which is the documentation generator we use.

Example Output

After running the above command (in step 2 above), you will be left with a file titled role-chart.json in the current working directory that might look something like this:

{
  "role_dependencies": [
    ["Role Dependency", "Description", "Supported OSes"],
    [
      "<a href='https://gitlab.com/megabyte-space/ansible-roles/androidstudio'>professormanhattan.androidstudio</a>",
      "Installs Android Studio on nearly any OS",
      "Supported OS feature not part of this task"
    ],
    [
      "<a href='https://gitlab.com/megabyte-space/ansible-roles/appium'>professormanhattan.appium</a>",
      "Installs Appium on almost any platform",
      "Supported OS feature not part of this task"
    ],
    [
      "<a href='https://gitlab.com/megabyte-space/ansible-roles/autokey'>professormanhattan.autokey</a>",
      "Installs AutoKey on Linux or AutoHotkey on Windows",
      "Supported OS feature not part of this task"
    ]
  ]
}

Populating the Role Dependency Chart for Individual Roles

You can also generate a role dependency chart for individual roles. Instead of scanning the roles/ folder to find roles, it looks at the requirements.yml. For each role in the requirements.yml file, it will include a line in the dependency chart. The chart includes all of the same details as the main playbook dependency chart.

Automatically Updating platforms: in galaxy_info:

Every role that is published to Ansible Galaxy needs to include a file in meta/main.yml that Ansible Galaxy can use to display your role to the right users. One way the Ansible Galaxy meta/main.yml file does this is by providing a section in the file called platforms: where information can be populated to tell Ansible Galaxy which operating systems your role will work on. For hundreds of roles, this can be a tedious process.

Many of the roles available on Ansible Galaxy haphazardly list a long list of platforms which the role obviously was not tested on. That does not cut it for us. To address this issue, we developed an automated system for properly generating the platforms: compatibility chart in meta/main.yml. You can get your platforms: variable automatically populated the right way by using our two-step system:

  1. First, follow the instructions provided by our Ansible Molecule JSON project to set your role(s) up with automated testing
  2. With the JSON data that Ansible Molecule JSON generates, you can automatically populate the meta/main.yml platforms: section by running ansibler TODO

Example Output

After running the command (in step 2 above), you should be able to see a proper platforms: section in any of the roles you generated the compatibility data for. The platforms: section of the meta/main.yml file in each role should look something like this:

The Ansible community is really in need of something like this. The platforms: section should provide useful data instead of just saying that the role supports all versions of every operating system which is the case way too often.

-----------------------------------------------------

➤ Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page. If you would like to contribute, please take a look at the contributing guide.

Brian Zalewski

-----------------------------------------------------

➤ License

Copyright © 2021 Megabyte LLC. This project is MIT licensed.