Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clarify registered vs facts #45432

Merged
merged 2 commits into from
Nov 29, 2018
Merged

clarify registered vs facts #45432

merged 2 commits into from
Nov 29, 2018

Conversation

bcoca
Copy link
Member

@bcoca bcoca commented Sep 10, 2018

SUMMARY

fixes #45411

ISSUE TYPE
  • Docs Pull Request
COMPONENT NAME

docs

ANSIBLE VERSION
2.x

@ansibot
Copy link
Contributor

ansibot commented Sep 10, 2018

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 docs This issue/PR relates to or includes documentation. needs_triage Needs a first human triage before being processed. small_patch support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 10, 2018
@bcoca bcoca removed needs_triage Needs a first human triage before being processed. labels Sep 10, 2018
@nkakouros
Copy link
Contributor

To ask to have registered variables be delegated as facts, is it an overkill?

@bcoca
Copy link
Member Author

bcoca commented Sep 10, 2018

not something i would do under delegated facts as they are not facts

Registered variables are valid on the host the remainder of the playbook run, which is the same as the lifetime of "facts"
in Ansible. Effectively registered variables are just like facts.
Registered variables are valid on the host the remainder of the playbook run, which is similar to the lifetime of "facts" in Ansible.
Both registered variables and facts are host level variables, but they are not the same thing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do registered variables differ from facts? Where is a user most likely to run into that difference?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several ways, but the main ones are:

  • precedence: they follow different priorities
  • caching: facts are backed by the 'configured cache plugin' vs registered vars are always just kept 'in memory'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the suggested text include the precedence and caching details?

The text "which is similar to the lifetime of "facts" in Ansible." does not clarify the validity for me.

Suggested change
Both registered variables and facts are host level variables, but they are not the same thing.
Registered variables are valid on the host the remainder of the playbook run.

The text "but they are not the same thing." also does not help me.

Suggested change
Both registered variables and facts are host level variables, but they are not the same thing.
Both registered variables and facts are host level variables.

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Sep 21, 2018
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Sep 29, 2018
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Oct 7, 2018
@ansibot ansibot added the core_review In order to be merged, this PR must follow the core review workflow. label Oct 25, 2018
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Nov 21, 2018
@evrardjp
Copy link
Contributor

I consider this is already an improvement on the text.

@samccann samccann merged commit 8461321 into ansible:devel Nov 29, 2018
kbreit pushed a commit to kbreit/ansible that referenced this pull request Jan 11, 2019
* clarify registered vs facts

fixes ansible#45411

* wordsmithing
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 core_review In order to be merged, this PR must follow the core review workflow. docs This issue/PR relates to or includes documentation. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Registered variable is not delegated as a fact
7 participants