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
6b500788
Commit
6b500788
authored
Apr 12, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add defaults to command help to avoid a certain class of user questions.
parent
61295742
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
bin/ansible
+2
-1
lib/ansible/utils.py
+15
-9
No files found.
bin/ansible
View file @
6b500788
...
...
@@ -52,7 +52,8 @@ class Cli(object):
parser
.
add_option
(
'-a'
,
'--args'
,
dest
=
'module_args'
,
help
=
"module arguments"
,
default
=
C
.
DEFAULT_MODULE_ARGS
)
parser
.
add_option
(
'-m'
,
'--module-name'
,
dest
=
'module_name'
,
help
=
"module name to execute"
,
default
=
C
.
DEFAULT_MODULE_NAME
)
help
=
"module name to execute (default=
%
s)"
%
C
.
DEFAULT_MODULE_NAME
,
default
=
C
.
DEFAULT_MODULE_NAME
)
options
,
args
=
parser
.
parse_args
()
self
.
callbacks
.
options
=
options
...
...
lib/ansible/utils.py
View file @
6b500788
...
...
@@ -284,19 +284,23 @@ def base_parser(constants=C, usage="", output_opts=False, runas_opts=False, asyn
parser
=
SortedOptParser
(
usage
)
parser
.
add_option
(
'-D'
,
'--debug'
,
default
=
False
,
action
=
"store_true"
,
help
=
'
enable standard error debugging of modules.
'
)
help
=
'
debug standard error output of remote modules
'
)
parser
.
add_option
(
'-f'
,
'--forks'
,
dest
=
'forks'
,
default
=
constants
.
DEFAULT_FORKS
,
type
=
'int'
,
help
=
'number of parallel processes to use'
)
help
=
"specify number of parallel processes to use (default=
%
s)"
%
constants
.
DEFAULT_FORKS
)
parser
.
add_option
(
'-i'
,
'--inventory-file'
,
dest
=
'inventory'
,
help
=
'inventory host file'
,
default
=
constants
.
DEFAULT_HOST_LIST
)
help
=
"specify inventory host file (default=
%
s)"
%
constants
.
DEFAULT_HOST_LIST
,
default
=
constants
.
DEFAULT_HOST_LIST
)
parser
.
add_option
(
'-k'
,
'--ask-pass'
,
default
=
False
,
action
=
'store_true'
,
help
=
'ask for SSH password'
)
parser
.
add_option
(
'-M'
,
'--module-path'
,
dest
=
'module_path'
,
help
=
"path to module library"
,
default
=
constants
.
DEFAULT_MODULE_PATH
)
help
=
"specify path to module library (default=
%
s)"
%
constants
.
DEFAULT_MODULE_PATH
,
default
=
constants
.
DEFAULT_MODULE_PATH
)
parser
.
add_option
(
'-T'
,
'--timeout'
,
default
=
constants
.
DEFAULT_TIMEOUT
,
type
=
'int'
,
dest
=
'timeout'
,
help
=
'set the SSH timeout in seconds'
)
dest
=
'timeout'
,
help
=
"override the SSH timeout in seconds (default=
%
s)"
%
constants
.
DEFAULT_TIMEOUT
)
parser
.
add_option
(
'-p'
,
'--port'
,
default
=
constants
.
DEFAULT_REMOTE_PORT
,
type
=
'int'
,
dest
=
'remote_port'
,
help
=
'set the remote ssh port'
)
dest
=
'remote_port'
,
help
=
"override the remote ssh port (default=
%
s)"
%
constants
.
DEFAULT_REMOTE_PORT
)
if
output_opts
:
parser
.
add_option
(
'-o'
,
'--one-line'
,
dest
=
'one_line'
,
action
=
'store_true'
,
...
...
@@ -308,7 +312,8 @@ def base_parser(constants=C, usage="", output_opts=False, runas_opts=False, asyn
parser
.
add_option
(
"-s"
,
"--sudo"
,
default
=
False
,
action
=
"store_true"
,
dest
=
'sudo'
,
help
=
"run operations with sudo (nopasswd)"
)
parser
.
add_option
(
'-u'
,
'--user'
,
default
=
constants
.
DEFAULT_REMOTE_USER
,
dest
=
'remote_user'
,
help
=
'connect as this user'
)
dest
=
'remote_user'
,
help
=
'connect as this user (default=
%
s)'
%
constants
.
DEFAULT_REMOTE_USER
)
if
connect_opts
:
parser
.
add_option
(
'-c'
,
'--connection'
,
dest
=
'connection'
,
...
...
@@ -318,9 +323,10 @@ def base_parser(constants=C, usage="", output_opts=False, runas_opts=False, asyn
if
async_opts
:
parser
.
add_option
(
'-P'
,
'--poll'
,
default
=
constants
.
DEFAULT_POLL_INTERVAL
,
type
=
'int'
,
dest
=
'poll_interval'
,
help
=
'set the poll interval if using -B'
)
dest
=
'poll_interval'
,
help
=
"set the poll interval if using -B (default=
%
s)"
%
constants
.
DEFAULT_POLL_INTERVAL
)
parser
.
add_option
(
'-B'
,
'--background'
,
dest
=
'seconds'
,
type
=
'int'
,
default
=
0
,
help
=
'run asynchronously, failing after X seconds'
)
help
=
'run asynchronously, failing after X seconds
(default=N/A)
'
)
return
parser
...
...
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