Git Product home page Git Product logo

ansible-discover's Introduction

Build Status PyPi Package

ansible-discover

ansible-discover is a command line tool to list dependencies and dependants of Ansible roles and playbooks, respectively.

One of its prime uses is in a CI tool like Jenkins. Once a change on, say a role, is committed, use ansible-discover to gather the dependant roles and playbooks. From this list, the respective CI jobs for playbook and role validations may then be triggered.

Installation

pip install ansible-discover

Usage

One use case (like outlined above) is to determine all roles (directly or indirectly) depending on a given set of roles:

ansible-discover roles predecessors PATHS

where PATHS is a space-delimited list of paths to roles (e.g., roles/my_sample_role).

In addition to predecessors (i.e., dependants) for roles, you can also discover

  • successors (i.e., dependencies) of roles: ansible-discover roles successors;
  • predecessors for playbooks: ansible-discover playbooks predecessors; and
  • successors of playbooks: ansible-discover playbooks successors.

Related tools

License

Distributed under the XYZ license. See LICENSE.txt for more information.

Contributing

  • Fork it!
  • Create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git commit -am 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request :)

ansible-discover's People

Contributors

croesnick avatar uspike avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

uspike

ansible-discover's Issues

Properly parse task includes

Scenario

p0.yml:

- hosts: all
  tasks:
    - include_tasks: t0.yml

t0.yml:

- import_tasks: t1.yml
- include_role:
    name: r0

Actual Behaviour

The top-level task include in p0.yml is not parsed, and so isn't the role include in t0.yml.

Expected Behavior

We should get the dependency chain

p0.yml ---> t0.yml ----> t1.yml
                   \
                    +--> roles/r0

`ansiblediscover.graph` is not a package

ansiblediscover/graph is a directory, and to be a python package it must contain a __init__.py. Without this, it is not being discovered by setuptools.find_packages and thus:

$ pip install ansible-discover
...
Successfully installed ansible-discover-0.1.0 ruamel.yaml-0.15.54
$ ansible-discover 
Traceback (most recent call last):
  File "/home/me/src/molecule/ansible-playbooks/venv/bin/ansible-discover", line 7, in <module>
    from ansiblediscover.cli import cli
  File "/home/me/src/molecule/ansible-playbooks/venv/lib/python3.6/site-packages/ansiblediscover/cli.py", line 8, in <module>
    from ansiblediscover.graph.dependencies import Dependencies
ModuleNotFoundError: No module named 'ansiblediscover.graph'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.