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
b8ba2d30
Commit
b8ba2d30
authored
Aug 21, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document variable precedence / rebuild
parent
68f07e83
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
54 additions
and
15 deletions
+54
-15
YAMLSyntax.html
+1
-1
api.html
+1
-1
bestpractices.html
+1
-1
examples.html
+1
-1
faq.html
+1
-1
genindex.html
+1
-1
gettingstarted.html
+1
-1
index.html
+1
-1
moduledev.html
+1
-1
modules.html
+1
-1
patterns.html
+1
-1
playbooks.html
+1
-1
playbooks2.html
+18
-1
rst/playbooks2.rst
+22
-0
search.html
+1
-1
searchindex.js
+0
-0
who_uses_ansible.html
+1
-1
No files found.
YAMLSyntax.html
View file @
b8ba2d30
...
...
@@ -289,7 +289,7 @@ languages:
</p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Aug 2
0
, 2012.
<br/>
Last updated on Aug 2
1
, 2012.
<br/>
</p>
</div>
</footer>
...
...
api.html
View file @
b8ba2d30
...
...
@@ -468,7 +468,7 @@ e.g.
</p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Aug 2
0
, 2012.
<br/>
Last updated on Aug 2
1
, 2012.
<br/>
</p>
</div>
</footer>
...
...
bestpractices.html
View file @
b8ba2d30
...
...
@@ -340,7 +340,7 @@ different variables to different geographies.</p>
</p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Aug 2
0
, 2012.
<br/>
Last updated on Aug 2
1
, 2012.
<br/>
</p>
</div>
</footer>
...
...
examples.html
View file @
b8ba2d30
...
...
@@ -442,7 +442,7 @@ what their names or IP addresses are).</p>
</p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Aug 2
0
, 2012.
<br/>
Last updated on Aug 2
1
, 2012.
<br/>
</p>
</div>
</footer>
...
...
faq.html
View file @
b8ba2d30
...
...
@@ -409,7 +409,7 @@ tasks – whether for a QA sytem, build system, or anything you can think of
</p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Aug 2
0
, 2012.
<br/>
Last updated on Aug 2
1
, 2012.
<br/>
</p>
</div>
</footer>
...
...
genindex.html
View file @
b8ba2d30
...
...
@@ -204,7 +204,7 @@ s.parentNode.insertBefore(ga, s);
</p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Aug 2
0
, 2012.
<br/>
Last updated on Aug 2
1
, 2012.
<br/>
</p>
</div>
</footer>
...
...
gettingstarted.html
View file @
b8ba2d30
...
...
@@ -410,7 +410,7 @@ explore, but you already have a fully working infrastructure!</p>
</p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Aug 2
0
, 2012.
<br/>
Last updated on Aug 2
1
, 2012.
<br/>
</p>
</div>
</footer>
...
...
index.html
View file @
b8ba2d30
...
...
@@ -419,7 +419,7 @@ Puppet Labs, and is now with <a class="reference external" href="http://rpath.co
</p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Aug 2
0
, 2012.
<br/>
Last updated on Aug 2
1
, 2012.
<br/>
</p>
</div>
</footer>
...
...
moduledev.html
View file @
b8ba2d30
...
...
@@ -511,7 +511,7 @@ the program. Stop by the mailing list to inquire about requirements.</p>
</p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Aug 2
0
, 2012.
<br/>
Last updated on Aug 2
1
, 2012.
<br/>
</p>
</div>
</footer>
...
...
modules.html
View file @
b8ba2d30
...
...
@@ -1800,7 +1800,7 @@ yum name=httpd state=installed</pre>
</p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Aug 2
0
, 2012.
<br/>
Last updated on Aug 2
1
, 2012.
<br/>
</p>
</div>
</footer>
...
...
patterns.html
View file @
b8ba2d30
...
...
@@ -392,7 +392,7 @@ Ansible 0.7. Ansible 0.6 includes a <a class="reference external" href="https:/
</p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Aug 2
0
, 2012.
<br/>
Last updated on Aug 2
1
, 2012.
<br/>
</p>
</div>
</footer>
...
...
playbooks.html
View file @
b8ba2d30
...
...
@@ -550,7 +550,7 @@ can do this:</p>
</p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Aug 2
0
, 2012.
<br/>
Last updated on Aug 2
1
, 2012.
<br/>
</p>
</div>
</footer>
...
...
playbooks2.html
View file @
b8ba2d30
...
...
@@ -168,6 +168,7 @@ s.parentNode.insertBefore(ga, s);
<li><a
class=
"reference internal"
href=
"#register-variables"
>
Register Variables
</a></li>
<li><a
class=
"reference internal"
href=
"#rolling-updates"
>
Rolling Updates
</a></li>
<li><a
class=
"reference internal"
href=
"#delegation"
>
Delegation
</a></li>
<li><a
class=
"reference internal"
href=
"#understanding-variable-precedence"
>
Understanding Variable Precedence
</a></li>
<li><a
class=
"reference internal"
href=
"#style-points"
>
Style Points
</a></li>
</ul>
</li>
...
...
@@ -652,6 +653,22 @@ a good idea:</p>
local_action: command /usr/bin/add_back_to_pool $inventory_hostname
</pre>
</div>
</div>
<div
class=
"section"
id=
"understanding-variable-precedence"
>
<h2>
Understanding Variable Precedence
<a
class=
"headerlink"
href=
"#understanding-variable-precedence"
title=
"Permalink to this headline"
>
¶
</a></h2>
<p>
You have already learned about inventory host and group variables,
‘
vars
’
, and
‘
vars_files
’
.
</p>
<p>
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.
</p>
<ol
class=
"arabic simple"
>
<li>
Variables loaded from YAML files mentioned in
‘
vars_files
’
in a playbook.
</li>
<li>
‘
vars
’
as defined in the playbook.
</li>
<li>
facts, whether built in or custom, or variables assigned from the
‘
register
’
keyword.
</li>
<li>
variables passed to parameterized task include statements.
</li>
<li>
Host variables from inventory.
</li>
<li>
Group variables from inventory, in order of least specific group to most specific.
</li>
</ol>
<p>
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.
</p>
</div>
<div
class=
"section"
id=
"style-points"
>
<h2>
Style Points
<a
class=
"headerlink"
href=
"#style-points"
title=
"Permalink to this headline"
>
¶
</a></h2>
<p>
Ansible playbooks are colorized. If you do not like this, set the ANSIBLE_NOCOLOR=1 environment variable.
</p>
...
...
@@ -708,7 +725,7 @@ a good idea:</p>
</p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Aug 2
0
, 2012.
<br/>
Last updated on Aug 2
1
, 2012.
<br/>
</p>
</div>
</footer>
...
...
rst/playbooks2.rst
View file @
b8ba2d30
...
...
@@ -517,6 +517,28 @@ Here is the same playbook as above, but using the shorthand syntax,
- name: add back to load balancer pool
local_action: command /usr/bin/add_back_to_pool $inventory_hostname
Understanding Variable Precedence
`````````````````````````````````
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
to determine which place sets the value of the variable.
1. Variables loaded from YAML files mentioned in 'vars_files' in a playbook.
2. 'vars' as defined in the playbook.
3. facts, whether built in or custom, or variables assigned from the 'register' keyword.
4. variables passed to parameterized task include statements.
5. Host variables from inventory.
6. Group variables from inventory, in order of least specific group to most specific.
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.
Style Points
````````````
...
...
search.html
View file @
b8ba2d30
...
...
@@ -221,7 +221,7 @@ s.parentNode.insertBefore(ga, s);
</p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Aug 2
0
, 2012.
<br/>
Last updated on Aug 2
1
, 2012.
<br/>
</p>
</div>
</footer>
...
...
searchindex.js
View file @
b8ba2d30
This diff is collapsed.
Click to expand it.
who_uses_ansible.html
View file @
b8ba2d30
...
...
@@ -269,7 +269,7 @@ s.parentNode.insertBefore(ga, s);
</p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Aug 2
0
, 2012.
<br/>
Last updated on Aug 2
1
, 2012.
<br/>
</p>
</div>
</footer>
...
...
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