Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
bc970a2
add meta/argument_specs.yml for all role variables
afeefghannam89 Jun 27, 2026
3b2968a
Add shared compact ansible-docsmith README template
afeefghannam89 Jun 27, 2026
26512d7
Add README generated from argument_specs
afeefghannam89 Jun 27, 2026
8f72f10
Make logstash_config_backup default an explicit boolean
afeefghannam89 Jun 27, 2026
37afcab
Add documentation gate (argument_specs validate + README freshness)
afeefghannam89 Jun 27, 2026
09dd2ef
Point docs to role README, ignore .docsmith in build
afeefghannam89 Jun 27, 2026
d91753b
docs: explain the argument_specs/README workflow for contributors
afeefghannam89 Jun 27, 2026
fff1a7b
Change workflow conditions
afeefghannam89 Jun 29, 2026
6366799
Remove extra lines
afeefghannam89 Jun 29, 2026
2bc7d35
Uodate the spec file
afeefghannam89 Jun 29, 2026
ca952c2
Fix pipeline doc to list format, merge duplicate into role doc
afeefghannam89 Jun 29, 2026
99e5948
Correct some variable description
afeefghannam89 Jun 29, 2026
542c722
Add Tags section in docs
afeefghannam89 Jun 29, 2026
9c3f884
Remove deprecated variable
afeefghannam89 Jun 29, 2026
0f067a2
drop unused logstash_queue_type
afeefghannam89 Jun 29, 2026
2949a78
show pipeline sub-options in README table, clarify persistent queues
afeefghannam89 Jun 29, 2026
680807e
correct logstash_beats_input_congestion description (items, not seconds)
afeefghannam89 Jun 30, 2026
d369515
Point in-config repo links to the collection instead of the old stand…
afeefghannam89 Jun 30, 2026
515a485
clarify what the role does in the intro and main spec description
afeefghannam89 Jun 30, 2026
2092846
Test the pipeline
afeefghannam89 Jun 30, 2026
98c37b1
Another test
afeefghannam89 Jun 30, 2026
7845f73
another test
afeefghannam89 Jun 30, 2026
5d83ea2
Another test
afeefghannam89 Jun 30, 2026
c79f335
Removes tests
afeefghannam89 Jun 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .docsmith/readme.md.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{# Compact README variable reference for ansible-docsmith. Shared by all roles.
Renders ONE table; nested sub-options (e.g. logstash_pipelines fields) appear as
indented rows. No per-variable detail sections, no table of contents.
Use with: --template-readme .docsmith/readme.md.j2 #}
{% macro row(name, spec, depth) -%}
{% set pad = '    ' * depth %}
{% set mark = '↳ ' if depth > 0 else '' %}
| {{ pad }}{{ mark }}`{{ name | ansible_escape }}` | `{{ spec.type }}`{% if spec.elements %} of `{{ spec.elements }}`{% endif %} | {% if spec.options %}…{% else %}{{ spec.default | format_default }}{% endif %} | {% if spec.choices %}{{ spec.choices | map('string') | map('code_escape') | join(', ') }}{% else %}—{% endif %} | {{ spec.description | format_table_description(name, 0) }} |
{% for sn, ss in (spec.options or {}).items() %}
{{ row(sn, ss, depth + 1) }}
{%- endfor %}
{%- endmacro %}
## Role variables<a id="variables"></a>

{% if has_options %}
| Variable | Type | Default | Choices | Description |
|----------|------|---------|---------|-------------|
{% for name, spec in options.items() %}
{{ row(name, spec, 0) }}
{%- endfor %}
{% else %}
No variables are defined for this role.
{% endif %}
73 changes: 73 additions & 0 deletions .github/workflows/test_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
name: Test Documentation
on:
workflow_dispatch:
pull_request:
paths:
- 'roles/**/meta/argument_specs.yml'
- 'roles/**/defaults/**'
- 'roles/**/README.md'
- '.docsmith/**'
- '.github/workflows/test_docs.yml'

# Cancel outdated pipeline runs when a new push occurs in the pull request.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
docs:
# For non-PR events (workflow_dispatch, etc.), github.event.pull_request.draft is null.
# GitHub Actions coerces null == false to true, so the job runs for all non-draft events.
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
env:
NO_COLOR: "1" # make ansible-docsmith print plain text so grep is reliable
steps:
- name: Check out the codebase.
uses: actions/checkout@v6

- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: "3.11"

# Pin the version: ansible-docsmith is a young tool, so we
# upgrade deliberately rather than picking up changes on every CI run.
- name: Install ansible-docsmith
run: python3 -m pip install ansible-docsmith==2.0.2

# Consistency between meta/argument_specs.yml and defaults/main.yml.
# validate exits 1 on ERROR by itself; here we additionally treat any
# WARNING (e.g. a default that differs between spec and defaults) as a failure.
- name: Validate argument_specs (warnings = errors)
run: |
set -uo pipefail
status=0
for role in roles/*/; do
[ -f "${role}meta/argument_specs.yml" ] || continue
echo "::group::validate ${role}"
out=$(ansible-docsmith validate "${role}" 2>&1) && rc=0 || rc=$?
echo "$out"
echo "::endgroup::"
if [ "$rc" -ne 0 ] || grep -q "Warnings:" <<<"$out"; then
echo "::error::ansible-docsmith reported errors or warnings for ${role}"
status=1
fi
done
exit $status
# README freshness: regenerate every role README and fail if anything changed,
# i.e. the committed README no longer matches argument_specs.yml.
- name: Check that every variable in README is up to date
run: |
for role in roles/*/; do
[ -f "${role}meta/argument_specs.yml" ] || continue
ansible-docsmith generate "${role}" --no-defaults \
--template-readme .docsmith/readme.md.j2
done
git diff --exit-code -- 'roles/*/README.md' || {
echo "::error::A role README is out of date. Run locally:";
echo " ansible-docsmith generate <role> --no-defaults --template-readme .docsmith/readme.md.j2";
exit 1;
}
1 change: 1 addition & 0 deletions .github/workflows/test_role_logstash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
pull_request:
paths:
- 'roles/logstash/**'
- '!roles/logstash/**/*.md'
- '.github/workflows/test_role_logstash.yml'
- 'molecule/logstash_**'

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test_roles_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ on:
pull_request:
paths:
- 'roles/**'
- '!roles/**/*.md'
- '!roles/**/meta/argument_specs.yml'
- 'molecule/elasticstack_default/**'
- 'requirements-test.txt'
- '.github/workflows/test_roles_pr.yml'
Expand Down
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Every role is documented with all variables, please refer to the documentation f
* [Beats](docs/role-beats.md)
* [Elasticsearch](docs/role-elasticsearch.md)
* [Kibana](docs/role-kibana.md)
* [Logstash](docs/role-logstash.md)
* [Logstash](roles/logstash/README.md)
* [Repos](docs/role-repos.md)

## Modules documentation
Expand Down Expand Up @@ -226,6 +226,25 @@ Every kind of contribution is very welcome. Open [issues](https://github.com/NET

For now we open pull requests against `main`. We are planning to introduce dedicated branches to support older versions without breaking changes. Since we don't need them for now, please check back with this section because when we decided on how to proceed, you will find the information here. For now `main` always has the newest changes and if you want a stable version, please use the newest release.

### Documentation for role variables

Role variables are documented from each role's `meta/argument_specs.yml`, which is
the single source of truth. When your pull request changes a role's variables:

1. Update that role's `meta/argument_specs.yml` (type, default, description).
2. Regenerate the README variable table — please do **not** edit it by hand. The table is
produced by [ansible-docsmith](https://github.com/foundata/ansible-docsmith)
(install with `pip install ansible-docsmith` if you don't have it):

```
ansible-docsmith generate roles/<role> --no-defaults --template-readme .docsmith/readme.md.j2
```

3. Commit the regenerated `README.md` together with your change.

The `Test Documentation` workflow checks that each README matches its
`argument_specs.yml` and fails the pull request if they drift apart.

## Testing

Besides real tests that the developer should do before creating a PR, we built molecule scenarios to test the complete stack.
Expand Down
18 changes: 18 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,28 @@

Remove the note above saying that this is a work and progress before the first release. And remove this section.

### Lint

Make sure to have one last pull request to remove as much lint as possible. Same goes for deprecation warnings, linter exceptions etc.

### Authors

Update the [.mailmap](.mailmap) and [AUTHORS](AUTHORS) files:

```
git log --use-mailmap | grep '^Author:' | cut -f2- -d' ' | sort | uniq > AUTHORS
```

## Tag

Tag the version. Don't use `v` in the name. Use semantic versioning.

e.g.

```
git tag -as 7.6.4
```

## Release

Make the tag a release on GitHub.
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Roles
* [Beats](role-beats.md)
* [Elasticsearch](role-elasticsearch.md)
* [Kibana](role-kibana.md)
* [Logstash](role-logstash.md)
* [Logstash](../roles/logstash/README.md)
* [Repos](role-repos.md)


Expand Down
Loading
Loading