Uploaded image for project: 'Product Technical Learning'
  1. Product Technical Learning
  2. PTL-5195

RH294-39: New text in variable scope discussion is misleading

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Major Major
    • RH294 - RHEL 8 0, RH294 - Early Access
    • RH294
    • 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."

              ghacker_jira George Hacker (Inactive)
              rht-rkastl Rudolf Kastl (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: