New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ansible-roster

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ansible-roster

Host based Ansible yaml inventory

  • 1.1.5
  • PyPI
  • Socket score

Maintainers
1

documentation license pipelines coverage

Ansible Roster Inventory Plugin

Roster is an Ansible inventory plugin with focus on groups applied to hosts instead of hosts included in groups. It supports ranges (eg: "[0:9]"), regex hostnames (eg: "(dev|prd)-srv"), file inclusions, and variable merging.

This inventory plugin has been written with debops in mind.

Installation from Ansible Galaxy

You can install the latest version from Ansible Galaxy repository.

ansible-galaxy collection install -U julien_lecomte.roster
python3 -mpip install boltons cerberus exrex

If you are using requirement.yml files for downloading collections and roles, add these lines:

collections:
  - julien_lecomte.roster

Installation from PyPI

You can install the latest version from PyPI package repository.

python3 -mpip install -U ansible-roster

Quickstart

Please refer to the full documentation for all the details.

The roster is a file in yaml format and 'yml' or 'yaml' file extension.

In order for Ansible to use the plugin and parse your roster file, several conditions must be met:

  • Your yaml file must contain a line indicating that the file is in the roster format.

  • You must activate plugins and enable the roster inventory plugin in your ansible.cfg, or in your .debops.cfg if using debops. If using debops, refresh the configuration with debops project refresh.

Sample ansible.cfg

[defaults]
# The following line prevents having to pass -i to ansible-inventory.
# Filename can be anything as long as it has a 'yml' or 'yaml' extension although
inventory = roster.yml

[inventory]
# You must enable the roster plugin if 'auto' does not work for you.
# Use 'roster' if installed via the Python package,
# Use 'julien_lecomte.roster.roster' if installed via Ansible Galaxy
enable_plugins = julien_lecomte.roster.roster

Sample .debops.cfg

[ansible inventory]
enabled = roster
# Use 'roster' if installed via the Python package,
# Use 'julien_lecomte.roster.roster' if installed via Ansible Galaxy
enable_plugins = julien_lecomte.roster.roster

Sample roster.yml

---
# This line is mandatory, and enables the plugin differenciating between
# any yaml file and a roster yaml file.
plugin: roster

vars:
  foobar01: "a global var"

groups:
  debian:
    vars:
      distrib: "debian"
  buster:
    parents:
      - debian
    vars:
      release: "buster"
  desktops:
    vars:
      components: "main contrib non-free"

hosts:
  desktop01.internal.example.com:
    groups:
      - desktops
      - buster

A larger example Roster inventory for DebOps can be found here: https://gitlab.com/jlecomte/ansible/ansible-roster-example.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Show your support by joining the Discord server (link below), or by adding a star to the project.

Locations

FAQs


Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc