Git Product home page Git Product logo

ansigenome's Introduction

PyPI version Build status

Ansigenome

Ansigenome is a command line tool designed to help you manage your Ansible roles.

Scan your roles and organize your documentation

Ansigenome scan screenshot

Create dependency graphs in seconds

Ansigenome graph of DebOps

Generated from the DebOps project.


...and more!

Table of contents

Use case

Are you someone with 1 or 100+ roles? Then you will benefit from using Ansigenome, let's go over what Ansigenome can do for you:

Gather metrics on your roles

Just run ansigenome scan at a path containing all of your roles or ansigenome scan /path/to/roles and it will gather stats such as:

  • Number of defaults, facts, files and lines found in each role and total them
  • Verify if you're missing meta or readme files

Will it change my roles?

Nope. This command is completely read only. All of your custom formatting and content is safe.

Standardize your readmes in an automated way

When I started to get to about 5 roles I dreaded making readmes for each one because there's so much boilerplate and duplication. We're programmers, so let's use tools to help us.

ansigenome gendoc will do the same as scan except it will read your meta/main.yml file and generate a readme based on the stats it found and also format your readme based on a jinja2 template.

It can generate both RST and MD readmes.

You can use the default template or optionally supply a custom template using blocks to customize the entire readme to your liking.

Will it change my roles?

It will not modify your meta file but it will overwrite your existing readme file for each role it's ran against. You can still add custom info to the readme, but this will be done through the meta file, don't worry about that just yet.

Can I see an example of what it generates?

Absolutely. This project sprung out of need while working on the DebOps project. There's about 60 roles all using an Ansigenome generated readme.

All of them were fully generated with 0 manual edits.

Augment existing meta files

You might have 35 roles already written and might want Ansigenome to help you make the adjustment over to using Ansigenome.

ansigenome genmeta will take a peek at your meta files for each role, replace certain fields with values you provided to its config (more on this later) and add ansigenome-only fields to that meta file.

If you wanted to migrate over to using Ansigenome then this is what you'll want to run before ansigenome gendoc. After running genmeta you will be able to take your old readme files and move some of it to the new meta file that genmeta made for you.

Will it change my roles?

It will rewrite your meta file for each role but it will not mess with your formatting. It will only augment a few fields that are missing and overwrite things like the galaxy_info.company name with what you supplied in the Ansigenome config (more on this later, we're almost there).

Export graphs and requirements files

Graphs

Just run ansigenome export -o <path to png output file> and it will use Graphviz to create a dependency graph.

You can also tweak the size and DPI of the graph with a few flags or even set the output format to be -f dot so you can pipe it to a different Graphviz graphing utility.

Requirements files

Have a go with ansigenome export -t reqs -o <path to output file> to generate a file for consumption by ansible-galaxy install -r <file>. It also supports the -f yml flag to use the new yaml format.

JSON dump

You can also dump everything Ansigenome gathered to json by running ansigenome export -t dump -o <path to output file>.

You could then feed that to some database back end or a javascript based graphing utility, etc..

Any chance to output to stdout instead of a file?

Yes, all of the export commands will output to stdout if you omit the -o flag. The only exception to this is the PNG graph.

Will it change my roles?

Not at all. It just reads a few files.

Create brand new roles

Everyone loves making new roles right? Well, ansigenome init <role name/path> will do just that for you. What's different from using ansible-galaxy init? Here, I'll tell you:

  • Creates an "Ansigenome ready" meta file
  • Creates a tests/ directory and .travis.yml file for you automatically

It uses a tool called Rolespec for the test code. Don't worry, you don't need to download anything.

You'll also never have to write messy Travis configs again but you can still benefit from Travis itself.

Will it change my roles?

Nah, but it will make a brand new shiny role for you.

Run shell commands in the context of each role

Sometimes you just want to run a shell command against all of your roles. Similar to how Ansible lets you run adhoc commands on hosts.

ansigenome -m 'touch foo' would create the foo file in the root directory of each role.

Installation

If you have Ansible installed then you already have all of the dependencies you need to run Ansigenome. Pick one of the way below:

# Pick an installation method that agrees with you.

pip install ansigenome
easy_install ansigenome

# If you want to live on the edge...

git clone https://github.com/nickjj/ansigenome
cd ansigenome ; sudo python setup.py develop

Quick start

So Ansigenome is installed, well done. Just run ansigenome config and answer a few questions. You only need to do this once.

At this point you can run any of the commands below.

Usage: ansigenome [config|scan|gendoc|genmeta|export|init|run] [--help] [options]


ansigenome config --help
create a necessary config file to make ansigenome work

ansigenome scan --help
scan a path containing Ansible roles and report back useful stats

ansigenome gendoc --help
generate a README from the meta file for each role

ansigenome genmeta --help
augment existing meta files to be compatible with Ansigenome

ansigenome export --help
export roles to a dependency graph, requirements file and more

ansigenome init --help
init new roles with a custom meta file and tests

ansigenome run --help
run shell commands inside of each role's directory


Options:
  --version   show program's version number and exit
  -h, --help  show this help message and exit

ansigenome command --help for more info on a command

Tips

  • Do not forget to check out the --help for each command
  • Learn how jinja2 extends works, you can use it for the readme template
    • You're best off copying the base README and place it next to the custom j2
    • Then you can {% extends "README.md.j2" %}
  • gendoc accepts -f md to generate markdown readmes instead of rst
  • scan, gendoc, genmeta and run don't require a roles path
    • It will try $PWD/playbooks/roles then $PWD
    • This allows you to run Ansigenome from your roles path easily
  • You can write a config out to a custom path with -o <path>
    • The non-home version of the config will be used if found
    • Feel free to edit the config file by hand later to change values
  • The export -t reqs command accepts a -v flag to read in a VERSION file
  • The init command accepts a -c flag
    • Supply a comma separated list of Galaxy categories
  • scan, gendoc, genmeta, run and dump accept an -l flag
    • Supply a comma separated list of roles to white list
  • If you are the only author you do not need to specify ansigenome_info.authors

Template variables

Here's the available variables you can use in your meta file or optional custom readme template:

# Access a single author (taken from your config).
author.name
author.company
author.url
author.email
author.twitter
author.github

# Access all of the authors.
authors

# License.
license.type
license.url

# SCM (source control management).
scm.type
scm.host
scm.user
scm.repo_prefix

# Dynamic items (they are calculated/normalized for you automatically).
role.name
role.galaxy_name
role.slug

# Standard items (you can access any property of these objects).
dependencies
galaxy_info
ansigenome_info

  # ansigenome_info fields.
  galaxy_id   : String based ID to find your role on the Galaxy
  travis      : Boolean to determine if this role is on Travis-CI

  status      : Dictionary with info about the status
     name        : String, currently supported are: beta, deprecated
     note        : String containing additional information about the status

  synopsis    : String block containing what your role does
  usage       : String block containing a detailed usage guide
  custom      : String block containing anything you want

  authors     : List containing information about each author

You can find many meta example files at the DebOps project page.

Custom readme template

You might decide that the current template doesn't suite your style. That's completely reasonable. You can supply your own readme template and extend the base one.

Just add the path to the custom readme template to your config file. Then copy the base template from this repo to somewhere on your workstation, perhaps next to your custom template.

Then in your custom template you can extend it like this:

{% extends "README.md.j2" %}

<insert the blocks you want to replace here>
Available blocks to replace
  • title
  • ansigenome_managed
  • badges
  • status
  • beta
  • deprecated
  • synopsis
  • installation
  • dependencies
  • standalone
  • defaults
  • facts
  • usage
  • authors
  • footer

Contributing

If you would like to contribute then check out Ansible's contribution guide because this project expects the same requirements and it contains great tips on using git branches.

In addition to that your code must pass the default pep8 style guide. I have Travis running a test to ensure the code follows that guide but your best bet is to find a plugin for your editor if you don't have one already.

Author

Ansigenome was created by Nick Janetakis [email protected].

Special thanks to @drybjed for coming up with the name of the tool. This project idea spawned from trying to break up the DebOps project into multiple roles. Neither of us wanted to manually make 50 repos and 50 readmes so I decided to learn Python and make this tool instead.

License

GPLv3

ansigenome's People

Contributors

davidlind avatar jimbocoder avatar julienvey avatar nickjj avatar rasputnik avatar yannig avatar ypid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansigenome's Issues

check template for defaults

I noticed when running this it did not report any defaults for my role however there are a number of defaults outside of the standard tasks folder

TypeError exception when using export command

I just installed ansigenome with pip install. Don't know if use it correctly, but it crash when I try to export a graph.

xxxx@xxxx:~/ansible/roles$ ansigenome export -o graph.png
Traceback (most recent call last):
File "/usr/local/bin/ansigenome", line 326, in
main()
File "/usr/local/bin/ansigenome", line 322, in main
fn(args, options, reloaded_config, parser)
File "/usr/local/bin/ansigenome", line 177, in execute_export
Scan(args, options, config, export=True)
File "/usr/local/lib/python2.7/dist-packages/ansigenome/scan.py", line 83, in init
self.scan_roles()
File "/usr/local/lib/python2.7/dist-packages/ansigenome/scan.py", line 117, in scan_roles
self.report["roles"][key] = self.report_role(key)
File "/usr/local/lib/python2.7/dist-packages/ansigenome/scan.py", line 190, in report_role
"meta": self.gather_meta(),
File "/usr/local/lib/python2.7/dist-packages/ansigenome/scan.py", line 213, in gather_meta
dep_list.append(dependency["role"])
TypeError: string indices must be integers, not str

ansigenome not installing properly

Hi Nick,

Thanks for putting together ansigenome, which I found at https://github.com/nickjj/ansigenome. It seems to be what I’m looking for, i.e. a tool to graphically show me what’s in my playbooks. However, I’m having issues getting it to install, and am wondering if you have thoughts on what’s wrong. Note that setuptools is already installed, so not sure why it’s giving that message.

On MacOS 10.11.6, python 3.6.5:

$ pip3 install ansigenome
Collecting ansigenome
Using cached https://files.pythonhosted.org/packages/68/82/f41ce20b98bd91e64ea49aee3660516c4d40f0a09ffa2c2932d4552c44c8/ansigenome-0.6.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/bh/7zd_g3hd4b7bkv2hf2_cnmwsf0zxn9/T/pip-install-9h5i5f1r/ansigenome/setup.py", line 8
print "Ansigenome needs setuptools in order to build. " +
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Ansigenome needs setuptools in order to build. " + )?

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

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/bh/7zd_g3hd4b7bkv2hf2_cnmwsf0zxn9/T/pip-install-9h5i5f1r/ansigenome/

On RHEL 6.7, python 3.4.2:

$ dzdo pip3.4 install ansigenome
Downloading/unpacking ansigenome
Downloading ansigenome-0.6.0.tar.gz (863kB): 863kB downloaded
Running setup.py (path:/tmp/pip_build_root/ansigenome/setup.py) egg_info for package ansigenome
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip_build_root/ansigenome/setup.py", line 8
print "Ansigenome needs setuptools in order to build. " +
^
SyntaxError: Missing parentheses in call to 'print'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "", line 17, in

File "/tmp/pip_build_root/ansigenome/setup.py", line 8

print "Ansigenome needs setuptools in order to build. " + \

                                                      ^

SyntaxError: Missing parentheses in call to 'print'


Cleaning up...

On MacOS, installing from source:

$ sudo python3 setup.py develop
Password:
File "setup.py", line 8
print "Ansigenome needs setuptools in order to build. " +
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Ansigenome needs setuptools in order to build. " + )?

$ pip3 install setuptools
Requirement already satisfied: setuptools in /usr/local/lib/python3.6/site-packages (39.0.1)

Exported png doesn't seem valid

Are there any requirements for what ansigenome expects when does a scan? I ask because I ran the following:

ansigenome scan directory-here/
ansigenome export -o /tmp/out.png

where directory-here contains my yaml playbooks and other include files that those yaml files refer to.

However, when I open /tmp/out.png, it just shows what seem to be a series of unconnected lines, laid out sequentially in a row. When I zoom in, it doesn't show me much; I can't make out anything for each line. I expected to see a graph of relationships, much like is shown in the README file on this github site.

I thought the reason I'm not seeing anything may have been because I have yaml files that are essentially just dictionary definitions or other files that are referred to, i.e. included, in the actual playbooks that have roles and hosts defined, i.e. that have a roles: and a hosts: section in the .yml file. So I copied to a subdirectory, and ran a scan on that subdirectory, but that doesn't even find any roles.

What do I need to do to see a graph of relationships like shown in the README?

Scan does not detect markdown readmes

Currently, running ansigenome scan still marks roles with markdown readmes (named README.md) as missing readmes, even if these readmes are generated by ansigenome itself.

86a62d40adac956784510ec11fe8ee197a9f05c8 broke `role.galaxy_name`

I already mentioned this in #47 (comment)
86a62d4 broke role.galaxy_name and with this also the links based on it.

I did not look more closely what the patch actually does.

Here is a mini working example using this template:

{{ role.galaxy_name | replace('-', '--')}}
{{ role.name | replace('-', '--')}}

And this role as an example: https://github.com/debops-contrib/ansible-apparmor

With 86a62d4, this generates the following:

debops--contrib.debops--contrib.apparmor
debops--contrib.apparmor

And with eb85483 (one commit before), it generates this:

debops--contrib.apparmor
apparmor

cc: @jimbocoder

PS: Might come in handy, I wrote a little wrapper script for ansigenome gendoc to handle multiple environments: https://github.com/ypid/ypid-ansible-common/tree/master/template_READMEs

License type out of range when first time setup is ran

Pick a license type by choosing a number:

  1. MIT
  2. GPLv2
  3. GPLv3
  5. LGPL
  6. Apache-2.0
  7. BSDv2
  8. BSDv3
  9. Other

 []: 9
Traceback (most recent call last):
  File "/usr/local/bin/ansigenome", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/Users/kgarland/Code/ansigenome/bin/ansigenome", line 326, in <module>
    main()
  File "/Users/kgarland/Code/ansigenome/bin/ansigenome", line 309, in main
    (config, config_path) = load_config()
  File "/Users/kgarland/Code/ansigenome/bin/ansigenome", line 248, in load_config
    Config([], {}, {})
  File "/Users/kgarland/Code/ansigenome/ansigenome/config.py", line 28, in __init__
    out_config = self.ask_questions()
  File "/Users/kgarland/Code/ansigenome/ansigenome/config.py", line 77, in ask_questions
    out_config["license_type"] = c.LICENSE_TYPES[answer][0]
IndexError: list index out of range

The reqs command could read in versions from a VERSION file

Use case:

You have 80 roles and want to keep track of the versions. Versioning the requirements file by hand is tedious.

Solution:

Each role has a VERSION file which is a git tag. When you run the reqs command with -v|--version it will read in that version and write it out to the requirements file.

Roles that are unversioned by either an empty VERSION file or no VERSION file will be written out as master for the version.

ansigenome 0.6.0 ignores the ansigenome.yml

Hi, very useful tool,
we finally managed to have a PoC of ansigenome working on my local mac, with ansigenome 0.5.6 from ypid. ANd it works ok with the meta/ansigenome.yml a custom template in md format.

The same role and the same ansigenome.conf used on a Linux host with ansigenome 0.6.0 installed by pip ignore anything in the ansigenome.yml.

I can provide logs if instructed how to.
Thanks!

Warning: <stdin>: syntax error in line 1 near 'No'

If I use the command line to export roles dependencies into a png file, the bellow error is displayed:

$ ansigenome export ./git_repos/devops/roles/ -o ./git_repos/devops/roles/role_schema.png
Warning: <stdin>: syntax error in line 1 near 'No'

But it works if I go to role directory and execute the command like as bellow:

$ cd ./git_repos/devops/roles/ && ansigenome export -o role_schema.png

Make it possible to use $HOME in options_readme_template

Hi

Great project. Is it possible to specify the path to the readme template as follows, where ~ would be expanded as $HOME?

options_readme_template: ~/.ansigenome/ypid.README.rst.j2

Currently, ansigenome says:

The following template could not be found:
~/.ansigenome/README.rst.j2

or

The following template could not be found:
$HOME/.ansigenome/README.rst.j2

Ansigenome missed one instance of a internal variable.

Hi

I just noticed that Ansigenome missed packages__whitelist_by_vars_combined which is used in the same set_fact tasks as packages__blacklist_by_vars_combined (is which is listed as expected). Without looking into the code I would expected that Ansigenome only finds the first occurrence of variables in set_fact tasks?

ypid/ansible-packages@b609f76

https://github.com/ypid/ansible-packages/blob/b609f7683f2adf04890d550b772f6f5ac19542ed/tasks/include_item_vars.yml#L7-L13

Support Ansible custom filters

As this tool is tightly related to Ansible and folks using Ansigenome are probably very familiar with Ansible’s custom Jinja filters I think it would come in handy to support them. From what I saw when I last checked, Ansible has all the filters defined in one Python module. I played with that for a different project but Ansible has quite some dependencies. So not too easy unfortunately.

Python 3 incompatibility

Please fix/handle Python 3 incompatibility.
When I tried to install, I got this:

halis@eleanor ~ (master) $ pip install ansigenome
Collecting ansigenome
  Using cached ansigenome-0.5.6.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-build-xng2b7ao/ansigenome/setup.py", line 8
        print "Ansigenome needs setuptools in order to build. " + \
                                                              ^
    SyntaxError: Missing parentheses in call to 'print'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-xng2b7ao/ansigenome

Some version info:

halis@eleanor ~ (master) $ pip -V
pip 7.1.2 from /usr/lib64/python3.4/site-packages (python 3.4)

halis@eleanor ~ (master) $ python
Python 3.4.3 (default, Nov 11 2015, 11:23:26) 
[GCC 4.9.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

Provide a list of licenses to choose from

Picking licenses and providing URLs for them is hard.

Show an user a list of known popular licenses - MIT, BSD, Apache 2.0, GPLv2, GPLv3, other (to specify name and URL). If a user selects one of the known licenses, configure it with an URL to http://tldrlegal.com/.

Python 2.6 support

Is there support for Python2.6 planned? I want to use ansigenome on RHEL6 and Python 2.6 is the default there.

Currently, it crashes with the following exception, as Python 2.6 doesn't support dict comprehensions (I guess).

Traceback (most recent call last):
  File "/usr/bin/ansigenome", line 5, in <module>
    pkg_resources.run_script('ansigenome==0.5.1', 'ansigenome')
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 461, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1194, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/lib/python2.6/site-packages/ansigenome-0.5.1-py2.6.egg/EGG-INFO/scripts/ansigenome", line 8, in <module>
    import ansigenome.constants as c
  File "/usr/lib/python2.6/site-packages/ansigenome-0.5.1-py2.6.egg/ansigenome/constants.py", line 4, in <module>
    import utils
  File "/usr/lib/python2.6/site-packages/ansigenome-0.5.1-py2.6.egg/ansigenome/utils.py", line 128
    return {v[key]: v for v in items}.values()
                        ^
SyntaxError: invalid syntax

parser fails due to "Too many levels of symbolic links"

I attempted to run this on my repository to get a feel for what our graph looks like and it failed with the error message:

Traceback (most recent call last):
  File "./ansigenome", line 326, in <module>
    main()
  File "./ansigenome", line 322, in main
    fn(args, options, reloaded_config, parser)
  File "./ansigenome", line 153, in execute_scan
    Scan(args, options, config)
  File "/home/kwoodson/git/ansigenome/ansigenome/scan.py", line 83, in __init__
    self.scan_roles()
  File "/home/kwoodson/git/ansigenome/ansigenome/scan.py", line 117, in scan_roles
    self.report["roles"][key] = self.report_role(key)
  File "/home/kwoodson/git/ansigenome/ansigenome/scan.py", line 185, in report_role
    "total_lines": self.gather_lines(),
  File "/home/kwoodson/git/ansigenome/ansigenome/scan.py", line 315, in gather_lines
    with open(full_path, "r") as f:
IOError: [Errno 40] Too many levels of symbolic links: '/home/kwoodson/git/openshift-ansible/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks'

It looks like it started doing a recursive decent and was broken by the symlinks.

Possible fixes:

  • Keep a hash of the paths that have been covered as to not descend more than once.
  • Add flag --no-symlinks

If I can find some time I'll look at submitting a patch.

Add ability to ignore role's subfolders

Hi,

I'm currently using Molecule. It creates a molecule sub-folder in each role, in which we can find some playbooks unrelated to the functioning of the role. Ansigenome scans this directory and finds some variables that are listed as "internal variables".

Would it be possible to add the ability to ignore some role's sub-folders to Ansigenome? It would allow me to ignore the molecule sub-folder and prevent useless variables to be listed in the generated README.

Regards

ansigenome config fails with non ASCII characters

I've installed ansigenome in virtual env running Python 2.7.3. After running ansigenome config I got following traceback:

Traceback (most recent call last):
  File "/home/scibi/.virtualenvs/ansible_xxxxx/bin/ansigenome", line 326, in <module>
    main()
  File "/home/scibi/.virtualenvs/ansible_xxxxx/bin/ansigenome", line 309, in main
    (config, config_path) = load_config()
  File "/home/scibi/.virtualenvs/ansible_xxxxx/bin/ansigenome", line 248, in load_config
    Config([], {}, {})
  File "/home/scibi/.virtualenvs/ansible_xxxxx/local/lib/python2.7/site-packages/ansigenome/config.py", line 29, in __init__
    utils.write_config(self.config_path, out_config)
  File "/home/scibi/.virtualenvs/ansible_xxxxx/local/lib/python2.7/site-packages/ansigenome/utils.py", line 398, in write_config
    string_to_file(path, config_as_string)
  File "/home/scibi/.virtualenvs/ansible_xxxxx/local/lib/python2.7/site-packages/ansigenome/utils.py", line 50, in string_to_file
    file.write(input)
  File "/home/scibi/.virtualenvs/ansible_xxxxx/lib/python2.7/codecs.py", line 691, in write
    return self.writer.write(data)
  File "/home/scibi/.virtualenvs/ansible_xxxxx/lib/python2.7/codecs.py", line 351, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 81: ordinal not in range(128)

The cause of that was letter 'Ś' in my name. Replacing it with 'S' "solved" the issue.

Ansible vs non-ansible machine(s) graph

How hard would it be to bend this fantastic tool into a dynamic machine graph (via gather_facts)?

My usecase would be to have ansigenome assess the "ansible coverage" over a bunch of machines. That is, how many machines have been "ansiblized" using roles vs those that were installed manually (legacy manual installations).

Like regular developers do with test coverage.

variables graph

Hi,
would it be possible to track variables visually in a similar way?
we have 3 places from where a variable can be changed: role, group_vars and host_vars
Thanks!

template not found error

Hi, we use the latest ansigenome 0.6.0 at this point and we are getting into the habit of using our own templates.
The template is there in place, but the ansigenome gendoc cannot find it.

Traceback (most recent call last):
File "/usr/bin/ansigenome", line 326, in
main()
File "/usr/bin/ansigenome", line 322, in main
fn(args, options, reloaded_config, parser)
File "/usr/bin/ansigenome", line 161, in execute_gendoc
Scan(args, options, config, gendoc=True)
File "/usr/lib/python2.7/site-packages/ansigenome/scan.py", line 83, in init
self.scan_roles()
File "/usr/lib/python2.7/site-packages/ansigenome/scan.py", line 125, in scan_roles
self.write_readme(key)
File "/usr/lib/python2.7/site-packages/ansigenome/scan.py", line 435, in write_readme
j2_out = self.readme_template.render(self.readme_template_vars)
File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "", line 1, in top-level template code
File "/usr/lib/python2.7/site-packages/jinja2/loaders.py", line 286, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: redacted_path/README.md.j2

Thank you!

Roles don't connect to one another

Hi,

The picture will likely speak for itself:

Ansible dependency graph

The roles are not connected to one another and instead of having a graph where everything starts from the comb/ role and then connects to one another, ansigenome seems to miss that the roles should indeed all be connected.

Could you point me into the direction to fix it, please?

allow include templates from url

Hi,
this very nice tool we are adopting for some time ad try to fully automate the generation based on commits (not only precommit) (gitlab runner, jenkins job) , now gets more attention, in this phase we were wondering if the templates can be included from an online repo?
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.