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
92392908
Commit
92392908
authored
Jan 31, 2013
by
Daniel Hokka Zakrisson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1945 from skvidal/extravars
- make extra-vars override all other vars and facts in playbooks
parents
fabb2a61
83b9654c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletions
+5
-1
lib/ansible/playbook/__init__.py
+2
-1
lib/ansible/playbook/play.py
+3
-0
No files found.
lib/ansible/playbook/__init__.py
View file @
92392908
...
@@ -315,6 +315,8 @@ class PlayBook(object):
...
@@ -315,6 +315,8 @@ class PlayBook(object):
continue
continue
facts
=
result
.
get
(
'ansible_facts'
,
{})
facts
=
result
.
get
(
'ansible_facts'
,
{})
self
.
SETUP_CACHE
[
host
]
.
update
(
facts
)
self
.
SETUP_CACHE
[
host
]
.
update
(
facts
)
# extra vars need to always trump - so update again following the facts
self
.
SETUP_CACHE
[
host
]
.
update
(
self
.
extra_vars
)
if
task
.
register
:
if
task
.
register
:
if
'stdout'
in
result
:
if
'stdout'
in
result
:
result
[
'stdout_lines'
]
=
result
[
'stdout'
]
.
splitlines
()
result
[
'stdout_lines'
]
=
result
[
'stdout'
]
.
splitlines
()
...
@@ -390,7 +392,6 @@ class PlayBook(object):
...
@@ -390,7 +392,6 @@ class PlayBook(object):
''' run a list of tasks for a given pattern, in order '''
''' run a list of tasks for a given pattern, in order '''
self
.
callbacks
.
on_play_start
(
play
.
name
)
self
.
callbacks
.
on_play_start
(
play
.
name
)
# if no hosts matches this play, drop out
# if no hosts matches this play, drop out
if
not
self
.
inventory
.
list_hosts
(
play
.
hosts
):
if
not
self
.
inventory
.
list_hosts
(
play
.
hosts
):
self
.
callbacks
.
on_no_hosts_matched
()
self
.
callbacks
.
on_no_hosts_matched
()
...
...
lib/ansible/playbook/play.py
View file @
92392908
...
@@ -186,6 +186,9 @@ class Play(object):
...
@@ -186,6 +186,9 @@ class Play(object):
else
:
else
:
vars
.
update
(
self
.
vars
)
vars
.
update
(
self
.
vars
)
if
type
(
self
.
playbook
.
extra_vars
)
==
dict
:
vars
.
update
(
self
.
playbook
.
extra_vars
)
if
type
(
self
.
vars_prompt
)
==
list
:
if
type
(
self
.
vars_prompt
)
==
list
:
for
var
in
self
.
vars_prompt
:
for
var
in
self
.
vars_prompt
:
if
not
'name'
in
var
:
if
not
'name'
in
var
:
...
...
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