ansible-collection-hardening/.aar_doc.yml
Moritz 1b0576695e
feat: workflow for roles readme (#705)
* chore: added aar_doc config

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* feat: added initial state of roles readme workflow

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: runs on

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: install poetry

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* feat: loop over all roles and install peotry with pip

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: working dir for poetry run

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: cli path

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* chore: scale down matrix loop for testing

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: poetry run for py execution command

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: work dir for poetry run

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: cli.py path

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: roles path

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* feat: push readme

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: on push branch master

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: uncomment other roles

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* chore: limit trigger to master and arguments

Co-authored-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: push branch name

Co-authored-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* refactor: simplify steps

Co-authored-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>
Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* style: linting and styling

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* chore: trigger for pull request

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: push only if ref is master

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* chore: output diff of generated README

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: push readme in pull request

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* docs: role var description text

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: aar_doc roles path

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: git diff

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: fetch all history and changed diff branch

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: run diff only for pr

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: remove fetch-depth and switch to normal diff

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: remove diff and set push-branch

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

* fix: head_ref with default ref_name for push-branch

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>

---------

Signed-off-by: Nemental <15136847+Nemental@users.noreply.github.com>
Co-authored-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>
2023-10-25 15:10:02 +02:00

44 lines
1 KiB
YAML

output_template: |
<!-- BEGIN_ANSIBLE_DOCS -->
## Supported Operating Systems
{%- for platform in metadata.galaxy_info.platforms %}
- {{ platform.name }}
{%- if "versions" in platform %}
- {{ platform.versions | default([]) | join(', ') }}
{%- endif %}
{%- endfor %}
## Role Variables
{% for entrypoint in argument_specs.keys() %}
{%- set path, options=entrypoint_options[entrypoint][0] -%}
{%- for name, details in options.items() |sort() %}
- `{{ name }}`
- Default: `{{ details.display_default }}`
- Description: {{ details.display_description }}
- Type: {{ details.display_type }}
- Required: {{ details.display_required }}
{%- endfor %}
{%- endfor %}
## Dependencies
{%- if ("dependencies" in metadata) and (metadata.dependencies | length > 0) %}
{%- for dependency in metadata.dependencies %}
- {{ dependency }}
{%- endfor %}
{%- else %}
None.
{%- endif %}
## Example Playbook
```
- hosts: all
roles:
- name: {{ role }}
```
<!-- END_ANSIBLE_DOCS -->