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
fad44862
Commit
fad44862
authored
Aug 05, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementing includes in the free strategy
parent
2b9b3a08
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletions
+28
-1
lib/ansible/plugins/strategies/free.py
+27
-0
lib/ansible/plugins/strategies/linear.py
+1
-1
No files found.
lib/ansible/plugins/strategies/free.py
View file @
fad44862
...
...
@@ -21,6 +21,8 @@ __metaclass__ = type
import
time
from
ansible.errors
import
*
from
ansible.playbook.included_file
import
IncludedFile
from
ansible.plugins.strategies
import
StrategyBase
try
:
...
...
@@ -140,6 +142,31 @@ class StrategyModule(StrategyBase):
results
=
self
.
_process_pending_results
(
iterator
)
host_results
.
extend
(
results
)
try
:
included_files
=
IncludedFile
.
process_include_results
(
host_results
,
self
.
_tqm
,
iterator
=
iterator
,
loader
=
self
.
_loader
,
variable_manager
=
self
.
_variable_manager
)
except
AnsibleError
,
e
:
return
False
if
len
(
included_files
)
>
0
:
for
included_file
in
included_files
:
# included hosts get the task list while those excluded get an equal-length
# list of noop tasks, to make sure that they continue running in lock-step
try
:
new_blocks
=
self
.
_load_included_file
(
included_file
,
iterator
=
iterator
)
except
AnsibleError
,
e
:
for
host
in
included_file
.
_hosts
:
iterator
.
mark_host_failed
(
host
)
self
.
_display
.
warning
(
str
(
e
))
continue
for
host
in
hosts_left
:
if
host
in
included_file
.
_hosts
:
task_vars
=
self
.
_variable_manager
.
get_vars
(
loader
=
self
.
_loader
,
play
=
iterator
.
_play
,
host
=
host
,
task
=
included_file
.
_task
)
final_blocks
=
[]
for
new_block
in
new_blocks
:
final_blocks
.
append
(
new_block
.
filter_tagged_tasks
(
play_context
,
task_vars
))
iterator
.
add_tasks
(
host
,
final_blocks
)
# pause briefly so we don't spin lock
time
.
sleep
(
0.05
)
...
...
lib/ansible/plugins/strategies/linear.py
View file @
fad44862
...
...
@@ -194,8 +194,8 @@ class StrategyModule(StrategyBase):
if
self
.
_take_step
(
task
):
choose_step
=
False
else
:
break
skip_rest
=
True
break
self
.
_display
.
debug
(
"getting variables"
)
task_vars
=
self
.
_variable_manager
.
get_vars
(
loader
=
self
.
_loader
,
play
=
iterator
.
_play
,
host
=
host
,
task
=
task
)
...
...
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