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
b355dca7
Commit
b355dca7
authored
Sep 24, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1081 from dsummersl/changelabel
Modified 'ok' to 'changed' when a change has occured
parents
b4543754
04c535b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
lib/ansible/callbacks.py
+9
-5
No files found.
lib/ansible/callbacks.py
View file @
b355dca7
...
@@ -310,25 +310,29 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
...
@@ -310,25 +310,29 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
host_result2
=
host_result
.
copy
()
host_result2
=
host_result
.
copy
()
host_result2
.
pop
(
'invocation'
,
None
)
host_result2
.
pop
(
'invocation'
,
None
)
changed
=
'changed'
in
host_result2
or
host_result
[
'changed'
]
ok_or_changed
=
'ok'
if
changed
:
ok_or_changed
=
'changed'
# show verbose output for non-setup module results if --verbose is used
# show verbose output for non-setup module results if --verbose is used
msg
=
''
msg
=
''
if
not
self
.
verbose
or
host_result2
.
get
(
"verbose_override"
,
None
)
is
not
None
:
if
not
self
.
verbose
or
host_result2
.
get
(
"verbose_override"
,
None
)
is
not
None
:
if
item
:
if
item
:
msg
=
"ok: [
%
s] => (item=
%
s)"
%
(
host
,
item
)
msg
=
"ok: [
%
s] => (item=
%
s)"
%
(
host
,
item
)
else
:
else
:
if
'ansible_job_id'
not
in
host_result
or
'finished'
in
host_result
:
if
'ansible_job_id'
not
in
host_result
or
'finished'
in
host_result
:
msg
=
"
ok: [
%
s]"
%
(
host
)
msg
=
"
%
s: [
%
s]"
%
(
ok_or_changed
,
host
)
else
:
else
:
# verbose ...
# verbose ...
if
item
:
if
item
:
msg
=
"
ok: [
%
s] => (item=
%
s) =>
%
s"
%
(
host
,
item
,
utils
.
jsonify
(
host_result2
))
msg
=
"
%
s: [
%
s] => (item=
%
s) =>
%
s"
%
(
ok_or_changed
,
host
,
item
,
utils
.
jsonify
(
host_result2
))
else
:
else
:
if
'ansible_job_id'
not
in
host_result
or
'finished'
in
host_result2
:
if
'ansible_job_id'
not
in
host_result
or
'finished'
in
host_result2
:
msg
=
"
ok
: [
%
s] =>
%
s"
%
(
host
,
utils
.
jsonify
(
host_result2
))
msg
=
"
%
s
: [
%
s] =>
%
s"
%
(
host
,
utils
.
jsonify
(
host_result2
))
if
msg
!=
''
:
if
msg
!=
''
:
if
not
'changed'
in
host_result2
or
not
host_result
[
'changed'
]
:
if
not
changed
:
print
stringc
(
msg
,
'green'
)
print
stringc
(
msg
,
'green'
)
else
:
else
:
print
stringc
(
msg
,
'yellow'
)
print
stringc
(
msg
,
'yellow'
)
...
...
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