Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
dd91452e
Commit
dd91452e
authored
Feb 02, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better explain precedence.
parent
bf088a50
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
docsite/rst/playbooks2.rst
+13
-8
No files found.
docsite/rst/playbooks2.rst
View file @
dd91452e
...
@@ -822,22 +822,27 @@ Understanding Variable Precedence
...
@@ -822,22 +822,27 @@ Understanding Variable Precedence
You have already learned about inventory host and group variables, 'vars', and 'vars_files'.
You have already learned about inventory host and group variables, 'vars', and 'vars_files'.
If a variable name is defined in more than one place with the same name, priority is as follows
If a variable name is defined in more than one place with the same name, priority is as follows
to determine which place sets the value of the variable.
to determine which place sets the value of the variable. Lower numbered items have the highest
priority.
1.
Variables loaded from YAML files mentioned in 'vars_files' in a playbook
.
1.
Any variables specified with --extra-vars (-e) on the ansible-playbook command line
.
2.
facts, whether built in or custom, or variables assigned from the 'register' keyword
.
2.
Variables loaded from YAML files mentioned in 'vars_files' in a playbook
.
3.
variables passed to parameterized task include statements
.
3.
facts, whether built in or custom, or variables assigned from the 'register' keyword
.
4.
'vars' as defined in the playbook
.
4.
variables passed to parameterized task include statements
.
5.
Host variables from inventory
.
5.
'vars' as defined in the playbook
.
6. Group variables from inventory, in order of least specific group to most specific.
6. Host variables from inventory.
7. Group variables from inventory in inheritance order. This means if a group includes a sub-group, the variables
in the subgroup have higher precedence.
Therefore, if you want to set a default value for something you wish to override somewhere else, the best
Therefore, if you want to set a default value for something you wish to override somewhere else, the best
place to set such a default is in a group variable.
place to set such a default is in a group variable. The 'group_vars/all' file makes an excellent place to put global
variables that are true across your entire site, since everything has higher priority than these values.
Style Points
Style Points
````````````
````````````
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment