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
c3cad500
Commit
c3cad500
authored
Apr 13, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update manpages, fix missing variable assignment
parent
f2465e05
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
8 deletions
+41
-8
bin/ansible
+2
-1
bin/ansible-playbook
+1
-1
docs/man/man1/ansible-playbook.1.asciidoc
+21
-0
docs/man/man1/ansible.1.asciidoc
+11
-2
lib/ansible/utils.py
+6
-4
No files found.
bin/ansible
View file @
c3cad500
...
...
@@ -47,7 +47,7 @@ class Cli(object):
def
parse
(
self
):
''' create an options parser for bin/ansible '''
parser
=
utils
.
base_parser
(
constants
=
C
,
runas_opts
=
True
,
async_opts
=
True
,
parser
=
utils
.
base_parser
(
constants
=
C
,
port_opts
=
True
,
runas_opts
=
True
,
async_opts
=
True
,
output_opts
=
True
,
connect_opts
=
True
,
usage
=
'
%
prog <host-pattern> [options]'
)
parser
.
add_option
(
'-a'
,
'--args'
,
dest
=
'module_args'
,
help
=
"module arguments"
,
default
=
C
.
DEFAULT_MODULE_ARGS
)
...
...
@@ -70,6 +70,7 @@ class Cli(object):
pattern
=
args
[
0
]
sshpass
=
None
sudopass
=
None
if
options
.
ask_pass
:
sshpass
=
getpass
.
getpass
(
prompt
=
"SSH password: "
)
if
options
.
ask_sudo_pass
:
...
...
bin/ansible-playbook
View file @
c3cad500
...
...
@@ -67,7 +67,7 @@ def main(args):
host_list
=
options
.
inventory
,
override_hosts
=
override_hosts
,
extra_vars
=
options
.
extra_vars
,
forks
=
options
.
forks
,
debug
=
options
.
debug
,
verbose
=
True
,
remote_pass
=
sshpass
,
remote_port
=
options
.
remote_port
,
remote_pass
=
sshpass
,
callbacks
=
playbook_cb
,
runner_callbacks
=
runner_cb
,
stats
=
stats
,
timeout
=
options
.
timeout
,
transport
=
options
.
connection
,
sudo_pass
=
sudopass
...
...
docs/man/man1/ansible-playbook.1.asciidoc
View file @
c3cad500
...
...
@@ -34,6 +34,10 @@ The names of one or more YAML format files to run as ansible playbooks.
OPTIONS
-------
*-D*, *--debug*
Print any messages the remote module sends to standard error to the console
*-i* 'PATH', *--inventory=*'PATH'::
...
...
@@ -55,11 +59,28 @@ Level of parallelism. 'NUM' is specified as an integer, the default is 5.
Prompt for the SSH password instead of assuming key-based authentication with ssh-agent.
*-K*, *--ask-sudo-pass*::
Prompt for the password to use for playbook plays that request sudo access, if any
*-T* 'SECONDS', *--timeout=*'SECONDS'::
Connection timeout to use when trying to talk to hosts, in 'SECONDS'.
*-e* 'EXTRA_VARS', *--extra_vars=*'EXTRA_VARS'::
An additional list of space delimited key=value pairs to pass into the playbook that are not
declared in the vars section of the playbook.
*-O* 'OVERRIDE_HOSTS', *--override-hosts=*'OVERRIDE_HOSTS'::
Ignore the inventory file and run the playbook against only these hosts. "hosts:" line
in playbook should be set to 'all' when using this option.
ENVIRONMENT
-----------
...
...
docs/man/man1/ansible.1.asciidoc
View file @
c3cad500
...
...
@@ -60,16 +60,25 @@ The 'DIRECTORY' to load modules from. The default is '/usr/share/ansible'.
The 'ARGUMENTS' to pass to the module.
*-D*, *--debug*
Print any messages the remote module sends to standard error to the console
*-k*, *--ask-pass*::
Prompt for the SSH password instead of assuming key-based authentication with ssh-agent.
*-K*, *--ask-sudo-pass*::
Prompt for the password to use with --sudo, if any
*-o*, *--one-line*::
Try to output everything on one line.
*-s*, *--sudo*::
Run the command as the user given by -u and sudo to root.
*-t* 'DIRECTORY', *--tree=*'DIRECTORY'::
...
...
@@ -91,14 +100,14 @@ Run commands in the background, killing the task after 'NUM' seconds.
Poll a background job every 'NUM' seconds. Requires *-B*.
*-u* 'USERNAME', *--remote-user=*'USERNAME'::
Use this remote 'USERNAME' instead of root.
*-c* 'CONNECTION', *--connection=*'CONNECTION'::
Connection type to use. Possible options are 'paramiko' and 'local'.
Connection type to use. Possible options are 'paramiko' (SSH) and 'local'.
Local is mostly useful for crontab or kickstarts.
INVENTORY
...
...
lib/ansible/utils.py
View file @
c3cad500
...
...
@@ -279,7 +279,7 @@ class SortedOptParser(optparse.OptionParser):
self
.
option_list
.
sort
(
key
=
methodcaller
(
'get_opt_string'
))
return
optparse
.
OptionParser
.
format_help
(
self
,
formatter
=
None
)
def
base_parser
(
constants
=
C
,
usage
=
""
,
output_opts
=
False
,
runas_opts
=
False
,
async_opts
=
False
,
connect_opts
=
False
):
def
base_parser
(
constants
=
C
,
usage
=
""
,
output_opts
=
False
,
port_opts
=
False
,
runas_opts
=
False
,
async_opts
=
False
,
connect_opts
=
False
):
''' create an options parser for any ansible script '''
parser
=
SortedOptParser
(
usage
)
...
...
@@ -300,9 +300,11 @@ def base_parser(constants=C, usage="", output_opts=False, runas_opts=False, asyn
parser
.
add_option
(
'-T'
,
'--timeout'
,
default
=
constants
.
DEFAULT_TIMEOUT
,
type
=
'int'
,
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
=
"override the remote ssh port (default=
%
s)"
%
constants
.
DEFAULT_REMOTE_PORT
)
if
port_opts
:
parser
.
add_option
(
'-p'
,
'--port'
,
default
=
constants
.
DEFAULT_REMOTE_PORT
,
type
=
'int'
,
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'
,
...
...
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