Skip to content

docs: document the return: key in role argument specs - #4062

Draft
spetrosi wants to merge 1 commit into
ansible:develfrom
spetrosi:role-return-docs
Draft

spetrosi wants to merge 1 commit into
ansible:develfrom
spetrosi:role-return-docs

Conversation

@spetrosi

Copy link
Copy Markdown
Contributor
SUMMARY

Document the optional return: key for roles in the role argument-spec "Specification format" section.

Roles can document the variables they set via a return: block per entry point in meta/argument_specs.yml, using the same format as module return values. ansible-doc and antsibull-docs render it as a "Return Variables" table. This documents the field and its sub-keys (description, type, elements, returned, sample, choices, version_added, nested contains), and adds a return: block to the sample specification.

Marked draft pending the ecosystem discussion linked below. This is the documentation piece of a cross-repo effort:

ISSUE TYPE
  • Docs Pull Request
COMPONENT NAME

docs/docsite/rst/playbook_guide/playbooks_reuse_roles.rst

ADDITIONAL INFORMATION

Discussion: https://forum.ansible.com/t/proposal-document-role-return-variables-in-argument-specs-yml-like-module-return/46469
Refs: ansible-community/antsibull-docs#491

Roles can document the variables they set via an optional return: block per
entry point in meta/argument_specs.yml, using the same format as module
return values (rendered as a "Return Variables" table by ansible-doc and
antsibull-docs). Document the field and its sub-keys in the role argument
spec "Specification format" section, and add a return: block to the sample.

Discussion: https://forum.ansible.com/t/proposal-document-role-return-variables-in-argument-specs-yml-like-module-return/46469
Refs: ansible-community/antsibull-docs#491

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ansible-documentation-bot ansible-documentation-bot Bot added the new_contributor This PR is the first contribution by a new community member. label Oct 13, 2026
@ansible-documentation-bot

Copy link
Copy Markdown
Contributor

Thanks for your Ansible docs contribution! We talk about Ansible documentation on Matrix at #docs:ansible.im if you ever want to join us and chat about the docs! We meet on Matrix every Tuesday. See the Ansible calendar for meeting details. We welcome additions to our weekly agenda items too. You can add the dawgs-meeting tag to a forum topic to bring it up at the next meeting.

This branch was previously deployed

1 inactive deployment
github-bot — 3bc9b1a9 Deployed Oct 13, 2026 by spetrosi via Label Issue/PR #6221
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new_contributor This PR is the first contribution by a new community member.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant