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
25119926
Commit
25119926
authored
Mar 31, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Surface module debug (-D) to /usr/bin/ansible also
parent
d7e5b390
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
0 deletions
+18
-0
bin/ansible
+3
-0
lib/ansible/callbacks.py
+6
-0
library/failtest
+6
-0
test/TestPlayBook.py
+3
-0
No files found.
bin/ansible
View file @
25119926
...
...
@@ -52,6 +52,8 @@ class Cli(object):
help
=
"module arguments"
,
default
=
C
.
DEFAULT_MODULE_ARGS
)
parser
.
add_option
(
'-B'
,
'--background'
,
dest
=
'seconds'
,
type
=
'int'
,
default
=
0
,
help
=
'run asynchronously, failing after X seconds'
)
parser
.
add_option
(
'-D'
,
'--debug'
,
default
=
False
,
action
=
"store_true"
,
help
=
'enable standard error debugging of modules.'
)
parser
.
add_option
(
'-f'
,
'--forks'
,
dest
=
'forks'
,
default
=
C
.
DEFAULT_FORKS
,
type
=
'int'
,
help
=
'number of parallel processes to use'
)
parser
.
add_option
(
'-i'
,
'--inventory-file'
,
dest
=
'inventory'
,
...
...
@@ -109,6 +111,7 @@ class Cli(object):
remote_port
=
options
.
remote_port
,
forks
=
options
.
forks
,
background
=
options
.
seconds
,
pattern
=
pattern
,
callbacks
=
self
.
callbacks
,
sudo
=
options
.
sudo
,
verbose
=
True
,
debug
=
options
.
debug
)
return
(
runner
,
runner
.
run
())
...
...
lib/ansible/callbacks.py
View file @
25119926
...
...
@@ -86,6 +86,9 @@ class DefaultRunnerCallbacks(object):
def
on_ok
(
self
,
host
,
res
):
pass
def
on_error
(
self
,
host
,
msg
):
pass
def
on_skipped
(
self
,
host
):
pass
...
...
@@ -115,6 +118,9 @@ class CliRunnerCallbacks(DefaultRunnerCallbacks):
def
on_skipped
(
self
,
host
):
pass
def
on_error
(
self
,
host
,
err
):
print
>>
sys
.
stderr
,
"stderr: [
%
s] =>
%
s
\n
"
%
(
host
,
err
)
def
_on_any
(
self
,
host
,
result
):
print
utils
.
host_report_msg
(
host
,
self
.
options
.
module_name
,
result
,
self
.
options
.
one_line
)
if
self
.
options
.
tree
:
...
...
library/failtest
View file @
25119926
...
...
@@ -17,12 +17,18 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
import
sys
try
:
import
json
except
ImportError
:
import
simplejson
as
json
print
>>
sys
.
stderr
,
"THIS IS A TEST FAILURE"
print
json
.
dumps
({
"failed"
:
True
,
"msg"
:
"this module always fails"
})
test/TestPlayBook.py
View file @
25119926
...
...
@@ -42,6 +42,9 @@ class TestCallbacks(object):
def
on_import_for_host
(
self
,
host
,
filename
):
EVENTS
.
append
([
'import'
,
[
host
,
filename
]])
def
on_error
(
self
,
host
,
msg
):
EVENTS
.
append
([
'stderr'
,
[
host
,
msg
])
def
on_not_import_for_host
(
self
,
host
,
missing_filename
):
pass
...
...
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