Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
ansibler
Advanced tools
Readme
Performs various tasks required for generating sleek documentation for Ansible playbooks and roles
Ansibler is a set of tools used to manage Ansible playbooks and roles. It provides the following functionality:
roles/
folder and extracts the description of each role from the meta/main.yml
file to a JSON file (that can be used to display a dependency chart similar to the one found in the Playr repository). This task also injects the project build status and icons representing which operating systems a role supports into the JSON.roles/
folder, it will look at the requirements.yml
folder and generate the JSON that can be used to generate a role-dependency chart for roles that have dependencies.platforms:
in galaxy_info:
: When used in combination with Ansible Molecule JSON, it can automatically populate the platforms:
section in the galaxy_info:
of the meta/main.yml
file found in each role.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
Ansibler has several different features that can be individually run or run all at the same time.
To generate the role dependency chart (that you can see in the README of our Playr repository), you should:
roles/
folder of your project and that each role has a valid description.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.
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"
]
]
}
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.
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:
meta/main.yml
platforms:
section by running ansibler TODO
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.
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.
I create open source projects out of love. Although I have a job, shelter, and as much fast food as I can handle, it would still be pretty cool to be appreciated by the community for something I have spent a lot of time and money on. Please consider sponsoring me! Who knows? Maybe I will be able to quit my job and publish open source full time.
Sincerely,
Brian Zalewski
Copyright © 2021 Megabyte LLC. This project is MIT licensed.
FAQs
Performs various tasks required for generating sleek documentation for Ansible playbooks and roles
The npm package ansibler receives a total of 1 weekly downloads. As such, ansibler popularity was classified as not popular.
We found that ansibler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.