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
573d5f62
Commit
573d5f62
authored
Jun 09, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3159 from cchurch/devel
Callback Plugin Context / Naming Fixes
parents
b0bf39ef
d1de7839
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
5 deletions
+22
-5
lib/ansible/callback_plugins/noop.py
+2
-2
lib/ansible/playbook/__init__.py
+8
-3
plugins/callbacks/log_plays.py
+6
-0
plugins/callbacks/osx_say.py
+6
-0
No files found.
lib/ansible/callback_plugins/noop.py
View file @
573d5f62
...
...
@@ -63,10 +63,10 @@ class CallbackModule(object):
def
playbook_on_notify
(
self
,
host
,
handler
):
pass
def
on_no_hosts_matched
(
self
):
def
playbook_
on_no_hosts_matched
(
self
):
pass
def
on_no_hosts_remaining
(
self
):
def
playbook_
on_no_hosts_remaining
(
self
):
pass
def
playbook_on_task_start
(
self
,
name
,
is_conditional
):
...
...
lib/ansible/playbook/__init__.py
View file @
573d5f62
...
...
@@ -213,10 +213,7 @@ class PlayBook(object):
self
.
callbacks
.
on_start
()
for
(
play_ds
,
play_basedir
)
in
zip
(
self
.
playbook
,
self
.
play_basedirs
):
play
=
Play
(
self
,
play_ds
,
play_basedir
)
assert
play
is
not
None
ansible
.
callbacks
.
set_play
(
self
.
callbacks
,
play
)
ansible
.
callbacks
.
set_play
(
self
.
runner_callbacks
,
play
)
matched_tags
,
unmatched_tags
=
play
.
compare_tags
(
self
.
only_tags
)
matched_tags_all
=
matched_tags_all
|
matched_tags
...
...
@@ -242,8 +239,12 @@ class PlayBook(object):
raise
errors
.
AnsibleError
(
msg
%
(
unknown
,
unmatched
))
for
play
in
plays
:
ansible
.
callbacks
.
set_play
(
self
.
callbacks
,
play
)
ansible
.
callbacks
.
set_play
(
self
.
runner_callbacks
,
play
)
if
not
self
.
_run_play
(
play
):
break
ansible
.
callbacks
.
set_play
(
self
.
callbacks
,
None
)
ansible
.
callbacks
.
set_play
(
self
.
runner_callbacks
,
None
)
# summarize the results
results
=
{}
...
...
@@ -325,6 +326,8 @@ class PlayBook(object):
self
.
callbacks
.
on_task_start
(
template
(
play
.
basedir
,
task
.
name
,
task
.
module_vars
,
lookup_fatal
=
False
),
is_handler
)
if
hasattr
(
self
.
callbacks
,
'skip_task'
)
and
self
.
callbacks
.
skip_task
:
ansible
.
callbacks
.
set_task
(
self
.
callbacks
,
None
)
ansible
.
callbacks
.
set_task
(
self
.
runner_callbacks
,
None
)
return
True
# load up an appropriate ansible runner to run the task in parallel
...
...
@@ -365,6 +368,8 @@ class PlayBook(object):
for
handler_name
in
task
.
notify
:
self
.
_flag_handler
(
play
,
template
(
play
.
basedir
,
handler_name
,
task
.
module_vars
),
host
)
ansible
.
callbacks
.
set_task
(
self
.
callbacks
,
None
)
ansible
.
callbacks
.
set_task
(
self
.
runner_callbacks
,
None
)
return
hosts_remaining
# *****************************************************
...
...
plugins/callbacks/log_plays.py
View file @
573d5f62
...
...
@@ -90,6 +90,12 @@ class CallbackModule(object):
def
playbook_on_notify
(
self
,
host
,
handler
):
pass
def
playbook_on_no_hosts_matched
(
self
):
pass
def
playbook_on_no_hosts_remaining
(
self
):
pass
def
playbook_on_task_start
(
self
,
name
,
is_conditional
):
pass
...
...
plugins/callbacks/osx_say.py
View file @
573d5f62
...
...
@@ -67,6 +67,12 @@ class CallbackModule(object):
def
playbook_on_notify
(
self
,
host
,
handler
):
say
(
"pew"
,
LASER_VOICE
)
def
playbook_on_no_hosts_matched
(
self
):
pass
def
playbook_on_no_hosts_remaining
(
self
):
pass
def
playbook_on_task_start
(
self
,
name
,
is_conditional
):
if
not
is_conditional
:
say
(
"Starting task:
%
s"
%
name
,
REGULAR_VOICE
)
...
...
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