-
Story
-
Resolution: Done
-
Major
-
RH294 - RHEL 8 0, RH294 - Early Access
-
None
-
4
-
ROLE
-
en-US (English)
URL: https://role.rhu.redhat.com/rol-rhu/rhz/rhls/course/rh294ea-8.0/ch04
Reporter RHNID: mmurphy1@redhat.com
Section: data-variables-lecture - Managing Variables
Language: en-US (English)||||||||
Workaround:
Description: in https://role.rhu.redhat.com/rol-rhu/rhz/rhls/course/rh294ea-8.0/ch04
the "defining variables" section (text below) is confusing to me.
It states that narrow scope takes precedence over wider scope, and then continues that command-line (global scope) will override playbook (play scope) and inventory (host scope). This seems contradictory.
Text:
"...this can be simplified to three basic scope levels:
Global scope: Variables set from the command line or Ansible configuration
Play scope: Variables set in the play and related structures
Host scope: Variables set on host groups and individual hosts by the inventory, fact gathering, or registered tasks
If the same variable name is defined at more than one level, the level with the highest precedence wins. A narrow scope takes precedence over a wider scope: variables defined by the inventory are overridden by variables defined by the playbook, which are overridden by variables defined on the command line."