You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the investigation of an ansible performance problem related to facts (ansible/ansible#73654) , it was found that having INJECT_FACTS_AS_VARS set to true (which is the default) can lead to a performance impact when processing result. The larger the amount of host facts, the longer task result processing takes. It would be beneficial to warn if someone is relying on these facts. Since it's dynamic, it might be difficult to determine which vars, but there are common ones like ansible_distribution* or ansible_{hostname,fqdn,nodename,os}
Additionally it might be beneficial to warn about an unfiltered setup module call as pulling in all the facts can have unintended performance issues.
This discussion was converted from issue #1384 on June 04, 2021 13:41.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
In the investigation of an ansible performance problem related to facts (ansible/ansible#73654) , it was found that having INJECT_FACTS_AS_VARS set to true (which is the default) can lead to a performance impact when processing result. The larger the amount of host facts, the longer task result processing takes. It would be beneficial to warn if someone is relying on these facts. Since it's dynamic, it might be difficult to determine which vars, but there are common ones like ansible_distribution* or ansible_{hostname,fqdn,nodename,os}
Additionally it might be beneficial to warn about an unfiltered setup module call as pulling in all the facts can have unintended performance issues.
Related changes: https://review.opendev.org/q/owner:aschultz%2540redhat.com+topic:ansible-facts
Issue Type
STEPS TO FIND SIMILAR VARS
I found our usage of these things by looking in our yaml files with something like:
grep ansible_ * -r | egrep -v "_(facts|become|user|host|limit|check_mode|ssh|connection|managed|verbose|job|home|log|loop|async|limit|filter|version|_inventory|\.py|group_vars)" | grep ansible_
Desired Behaviour
Warn when things like ansible_hostname, ansible_fqdn, ansible_distribution, etc are used.
Beta Was this translation helpful? Give feedback.
All reactions