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
1e0295c7
Commit
1e0295c7
authored
Nov 23, 2012
by
Daniel Hokka Zakrisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Template handlers late
This allows overriding variables in name, and removes templating from parsing.
parent
ebd31af9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
lib/ansible/playbook/__init__.py
+4
-4
lib/ansible/playbook/task.py
+0
-3
No files found.
lib/ansible/playbook/__init__.py
View file @
1e0295c7
...
...
@@ -308,13 +308,13 @@ class PlayBook(object):
for
host
,
results
in
results
.
get
(
'contacted'
,{})
.
iteritems
():
if
results
.
get
(
'changed'
,
False
):
for
handler_name
in
task
.
notify
:
self
.
_flag_handler
(
play
.
handlers
()
,
utils
.
template
(
play
.
basedir
,
handler_name
,
task
.
module_vars
),
host
)
self
.
_flag_handler
(
play
,
utils
.
template
(
play
.
basedir
,
handler_name
,
task
.
module_vars
),
host
)
return
hosts_remaining
# *****************************************************
def
_flag_handler
(
self
,
handlers
,
handler_name
,
host
):
def
_flag_handler
(
self
,
play
,
handler_name
,
host
):
'''
if a task has any notify elements, flag handlers for run
at end of execution cycle for hosts that have indicated
...
...
@@ -322,8 +322,8 @@ class PlayBook(object):
'''
found
=
False
for
x
in
handlers
:
if
handler_name
==
x
.
name
:
for
x
in
play
.
handlers
()
:
if
handler_name
==
utils
.
template
(
play
.
basedir
,
x
.
name
,
x
.
module_vars
)
:
found
=
True
self
.
callbacks
.
on_notify
(
host
,
x
.
name
)
x
.
notified_by
.
append
(
host
)
...
...
lib/ansible/playbook/task.py
View file @
1e0295c7
...
...
@@ -149,9 +149,6 @@ class Task(object):
# allow the user to list comma delimited tags
import_tags
=
import_tags
.
split
(
","
)
self
.
name
=
utils
.
template
(
None
,
self
.
name
,
self
.
module_vars
)
self
.
action
=
utils
.
template
(
None
,
self
.
action
,
self
.
module_vars
)
# handle mutually incompatible options
incompatibles
=
[
x
for
x
in
[
self
.
first_available_file
,
self
.
items_lookup_plugin
]
if
x
is
not
None
]
if
len
(
incompatibles
)
>
1
:
...
...
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