GithubHelp home page GithubHelp logo

ansiqa's Introduction

AnsiQA

A utility for managing Ansible Roles. Designed to be run inside the roles directory.

Inspired by ansigenome

Host Depends

depends functionality requires on graphviz to be installed.

Features

Stats

ansiqa stats

Prints stats about roles. With no arguments, stats will print the following for each:

  • Number of tasks
  • Number of variables set
  • Number of defaults set
  • If a README.* file is present
  • If meta/main.yml is present
  • If extras/main.yml is present (used by Ansiqa to generate READMEs)

Meta

ansiqa meta

Generate base meta files for roles from values in the AnsiQA config file.

Extra

ansiqa extra

Generate base extra files for roles from values in the AnsiQA config file, stored in extra/main.yml. These values are used by AnsiQA to generate READMEs.

Docs

ansiqa docs

Generate a README by filling a Jinja2 template. The readme template must end in .j2, and can be put in the following places:

  • Specified in the AnsiQA config file, by the root level token template
  • Found in the current working directory, matching the README.*.j2 glob
  • Found in the user's home directory, matching the README.*.j2 glob

This template is fed a role dictionary, which contains the following tokens

'name': the role name
'path': the role absolute path
'defaults': the defaults provided by the role, formatted as yaml
'files': a list of files by the role
'handlers': a list of handlers provided by the role
'meta': a dict containing the values in meta/main.yml
'tasks': a list of tasks provided by the role
'templates': a list of templates provided by the role
'tests': a boolean value, if the tests directory exists
'vars': the variables provided by the role, formatted as yaml
'extra': a dict containing the values in extra/main.yml

Depends

ansiqa depends

Dependency introspection. With no arguments, depends prints the number of dependencies each role has, the number of times each role is depended on, and the "dependency depth" of each role (how long the longest dependency chain is.)

With the --graph flag, ansiqa generates a GraphViz graph to visualize the dependency tree.

Configuration

The configuration file should be a yaml file named .ansiqa and be located either in the current working directory or in the user's home directory. It can have the following root level tokens

meta: A dict containing the default values for the meta/main.yml
extra: A dict containing the default values for the extra/main.yml
template: A string containing the path to the README template, first checking the current working directory for the path, then the home directory, and finally checking it as an absolute path.

ansiqa's People

Contributors

kulinacs avatar avdn avatar

Stargazers

Alexandre Chaussier avatar

Watchers

James Cloos avatar  avatar

Forkers

avdn

ansiqa's Issues

cannot install with pip

Looking for an alternate to ansigenome, your project looks interesting.
maybe I can get some help on the following error?

cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core)

pip install ansiqa DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. Collecting ansiqa Using cached https://files.pythonhosted.org/packages/e0/1e/2e3cedd754e71e2c853c1da0a07a45b1a20cd6514f6125b904424b2ddfd6/ansiqa-0.2.1.tar.gz ERROR: Complete output from command python setup.py egg_info: ERROR: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-XIN5wX/ansiqa/setup.py", line 10, in <module> with open(path.join(here, 'README.md'), encoding='utf-8') as f: File "/usr/lib64/python2.7/codecs.py", line 881, in open file = __builtin__.open(filename, mode, buffering) IOError: [Errno 2] No such file or directory: '/tmp/pip-install-XIN5wX/ansiqa/README.md' ---------------------------------------- ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-XIN5wX/ansiqa/

Thanks!

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.