claranet / ansible-gendoc

Auto generate Ansible documentation
Mozilla Public License 2.0
26 stars 7 forks source link

Make use of meta/argument_specs.yml if exists #11

Closed adaemmer closed 2 years ago

adaemmer commented 2 years ago

It would be nice if argument specification would be use. see https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html#role-argument-validation

stephrobert commented 2 years ago

It's a very good idea ! Thanks

stephrobert commented 2 years ago

What do you thing about this ?

Default variables

main

Install Memcached

Variable Name Description Type Elements Required Default
memcached_verbose enable verbose in log bool True
memcached_memory test int 64
argument_specs:
  main:
    short_description: Install Memcached
    options:
      memcached_verbose:
        description: enable verbose in log
        type: bool
        default: true
      memcached_memory:
        description: test
        default: 64
        type: int

Have you roles to test ?

adaemmer commented 2 years ago

Looks good. I would prefer to have this order Variable name, Required, Type, Default, Description. With type for lists e.g. list(str). All columns are relatively small so Description at the end could just grow.

If required is undefined it is false. You should print out false.

A good set of role to test could be https://github.com/ansible-middleware/wildfly