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
4ac2bafc
Commit
4ac2bafc
authored
Sep 03, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set hosts fact gathering flag based on fact cache entries
Fixes #12213
parent
7ece7677
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
lib/ansible/executor/play_iterator.py
+5
-1
lib/ansible/executor/task_queue_manager.py
+7
-1
No files found.
lib/ansible/executor/play_iterator.py
View file @
4ac2bafc
...
@@ -109,7 +109,7 @@ class PlayIterator:
...
@@ -109,7 +109,7 @@ class PlayIterator:
FAILED_RESCUE
=
4
FAILED_RESCUE
=
4
FAILED_ALWAYS
=
8
FAILED_ALWAYS
=
8
def
__init__
(
self
,
inventory
,
play
,
play_context
,
all_vars
):
def
__init__
(
self
,
inventory
,
play
,
play_context
,
variable_manager
,
all_vars
):
self
.
_play
=
play
self
.
_play
=
play
self
.
_blocks
=
[]
self
.
_blocks
=
[]
...
@@ -121,6 +121,10 @@ class PlayIterator:
...
@@ -121,6 +121,10 @@ class PlayIterator:
self
.
_host_states
=
{}
self
.
_host_states
=
{}
for
host
in
inventory
.
get_hosts
(
self
.
_play
.
hosts
):
for
host
in
inventory
.
get_hosts
(
self
.
_play
.
hosts
):
self
.
_host_states
[
host
.
name
]
=
HostState
(
blocks
=
self
.
_blocks
)
self
.
_host_states
[
host
.
name
]
=
HostState
(
blocks
=
self
.
_blocks
)
# if the host's name is in the variable manager's fact cache, then set
# its _gathered_facts flag to true for smart gathering tests later
if
host
.
name
in
variable_manager
.
_fact_cache
:
host
.
_gathered_facts
=
True
# if we're looking to start at a specific task, iterate through
# if we're looking to start at a specific task, iterate through
# the tasks for this host until we find the specified task
# the tasks for this host until we find the specified task
if
play_context
.
start_at_task
is
not
None
:
if
play_context
.
start_at_task
is
not
None
:
...
...
lib/ansible/executor/task_queue_manager.py
View file @
4ac2bafc
...
@@ -197,7 +197,13 @@ class TaskQueueManager:
...
@@ -197,7 +197,13 @@ class TaskQueueManager:
raise
AnsibleError
(
"Invalid play strategy specified:
%
s"
%
new_play
.
strategy
,
obj
=
play
.
_ds
)
raise
AnsibleError
(
"Invalid play strategy specified:
%
s"
%
new_play
.
strategy
,
obj
=
play
.
_ds
)
# build the iterator
# build the iterator
iterator
=
PlayIterator
(
inventory
=
self
.
_inventory
,
play
=
new_play
,
play_context
=
play_context
,
all_vars
=
all_vars
)
iterator
=
PlayIterator
(
inventory
=
self
.
_inventory
,
play
=
new_play
,
play_context
=
play_context
,
variable_manager
=
self
.
_variable_manager
,
all_vars
=
all_vars
,
)
# and run the play using the strategy
# and run the play using the strategy
return
strategy
.
run
(
iterator
,
play_context
)
return
strategy
.
run
(
iterator
,
play_context
)
...
...
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