Skip to content

Clarify role variable directory loading - #3824

Open
mogfrey wants to merge 1 commit into
ansible:develfrom
mogfrey:docs/clarify-role-variable-directories
Open

Clarify role variable directory loading#3824
mogfrey wants to merge 1 commit into
ansible:develfrom
mogfrey:docs/clarify-role-variable-directories

Conversation

@mogfrey

@mogfrey mogfrey commented Jul 21, 2026

Copy link
Copy Markdown

Summary

Clarify how Ansible loads variables from role defaults and vars directories.

The previous wording could imply that any nested directory under defaults/ or vars/ is loaded automatically. The updated text explains that:

  • Ansible automatically loads the main entry point.
  • defaults/main and vars/main may be files or directories.
  • Alternative files or directories must be selected explicitly with defaults_from or vars_from.

Fixes #2994.

Validation

  • nox -s spelling
  • nox -s "checkers(rstcheck)"
  • nox --force-python 3.13 -s "checkers(docs-build)"

Scope

Documentation only. No runtime behaviour is changed.

@ansible-documentation-bot ansible-documentation-bot Bot added the new_contributor This PR is the first contribution by a new community member. label Jul 21, 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.

Signed-off-by: Geoffrey Mogendi Okindo <26480893+mogfrey@users.noreply.github.com>
@mogfrey
mogfrey force-pushed the docs/clarify-role-variable-directories branch from b31d72f to cc0aa51 Compare July 21, 2026 12:17
@mogfrey
mogfrey marked this pull request as ready for review July 21, 2026 12:22
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.

Misleading statement about "defaults" and "vars" sub-folders of roles

1 participant