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
f06ec76f
Commit
f06ec76f
authored
Mar 28, 2012
by
Christopher Johnston
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add support for using an alternate remote port
parent
97776537
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
9 deletions
+16
-9
bin/ansible
+6
-2
lib/ansible/connection.py
+2
-1
lib/ansible/constants.py
+1
-2
lib/ansible/playbook.py
+4
-2
lib/ansible/runner.py
+3
-2
No files found.
bin/ansible
View file @
f06ec76f
...
...
@@ -73,6 +73,8 @@ class Cli(object):
dest
=
'timeout'
,
help
=
"set the SSH timeout in seconds"
)
parser
.
add_option
(
'-u'
,
'--user'
,
default
=
C
.
DEFAULT_REMOTE_USER
,
dest
=
'remote_user'
,
help
=
'connect as this user'
)
parser
.
add_option
(
'-p'
,
'--port'
,
default
=
C
.
DEFAULT_REMOTE_PORT
,
type
=
'int'
,
dest
=
'remote_port'
,
help
=
'set the remote ssh port'
)
options
,
args
=
parser
.
parse_args
()
self
.
callbacks
.
options
=
options
...
...
@@ -102,7 +104,8 @@ class Cli(object):
module_args
=
shlex
.
split
(
options
.
module_args
),
remote_user
=
options
.
remote_user
,
remote_pass
=
sshpass
,
host_list
=
options
.
inventory
,
timeout
=
options
.
timeout
,
forks
=
options
.
forks
,
background
=
options
.
seconds
,
pattern
=
pattern
,
remote_port
=
options
.
remote_port
,
forks
=
options
.
forks
,
background
=
options
.
seconds
,
pattern
=
pattern
,
callbacks
=
self
.
callbacks
,
verbose
=
True
,
)
return
(
runner
,
runner
.
run
())
...
...
@@ -116,7 +119,8 @@ class Cli(object):
module_args
=
[
"jid=
%
s"
%
jid
],
remote_user
=
old_runner
.
remote_user
,
remote_pass
=
old_runner
.
remote_pass
,
host_list
=
hosts
,
timeout
=
old_runner
.
timeout
,
forks
=
old_runner
.
forks
,
pattern
=
'*'
,
callbacks
=
self
.
silent_callbacks
,
verbose
=
True
,
remote_port
=
old_runner
.
remote_port
,
pattern
=
'*'
,
callbacks
=
self
.
silent_callbacks
,
verbose
=
True
,
)
# ----------------------------------------------
...
...
lib/ansible/connection.py
View file @
f06ec76f
...
...
@@ -65,7 +65,8 @@ class ParamikoConnection(object):
allow_agent
=
True
,
look_for_keys
=
True
,
password
=
self
.
runner
.
remote_pass
,
timeout
=
self
.
runner
.
timeout
timeout
=
self
.
runner
.
timeout
,
port
=
self
.
runner
.
remote_port
)
except
Exception
,
e
:
raise
errors
.
AnsibleConnectionFailed
(
str
(
e
))
...
...
lib/ansible/constants.py
View file @
f06ec76f
...
...
@@ -32,5 +32,4 @@ DEFAULT_TIMEOUT = 10
DEFAULT_POLL_INTERVAL
=
15
DEFAULT_REMOTE_USER
=
'root'
DEFAULT_REMOTE_PASS
=
None
DEFAULT_REMOTE_PORT
=
22
lib/ansible/playbook.py
View file @
f06ec76f
...
...
@@ -54,6 +54,7 @@ class PlayBook(object):
timeout
=
C
.
DEFAULT_TIMEOUT
,
remote_user
=
C
.
DEFAULT_REMOTE_USER
,
remote_pass
=
C
.
DEFAULT_REMOTE_PASS
,
remote_port
=
C
.
DEFAULT_REMOTE_PORT
,
override_hosts
=
None
,
verbose
=
False
,
callbacks
=
None
,
...
...
@@ -69,6 +70,7 @@ class PlayBook(object):
self
.
timeout
=
timeout
self
.
remote_user
=
remote_user
self
.
remote_pass
=
remote_pass
self
.
remote_port
=
remote_port
self
.
verbose
=
verbose
self
.
callbacks
=
callbacks
self
.
runner_callbacks
=
runner_callbacks
...
...
@@ -262,7 +264,7 @@ class PlayBook(object):
pattern
=
pattern
,
groups
=
self
.
groups
,
module_name
=
module
,
module_args
=
args
,
host_list
=
hosts
,
forks
=
self
.
forks
,
remote_pass
=
self
.
remote_pass
,
module_path
=
self
.
module_path
,
timeout
=
self
.
timeout
,
remote_user
=
remote_user
,
timeout
=
self
.
timeout
,
remote_user
=
remote_user
,
remote_port
=
self
.
remote_port
,
setup_cache
=
SETUP_CACHE
,
basedir
=
self
.
basedir
,
conditional
=
only_if
,
callbacks
=
self
.
runner_callbacks
,
)
...
...
@@ -426,7 +428,7 @@ class PlayBook(object):
pattern
=
pattern
,
groups
=
self
.
groups
,
module_name
=
'setup'
,
module_args
=
push_var_str
,
host_list
=
host_list
,
forks
=
self
.
forks
,
module_path
=
self
.
module_path
,
timeout
=
self
.
timeout
,
remote_user
=
user
,
timeout
=
self
.
timeout
,
remote_user
=
user
,
remote_port
=
self
.
remote_port
,
remote_pass
=
self
.
remote_pass
,
setup_cache
=
SETUP_CACHE
,
callbacks
=
self
.
runner_callbacks
,
)
.
run
()
...
...
lib/ansible/runner.py
View file @
f06ec76f
...
...
@@ -60,8 +60,8 @@ class Runner(object):
module_name
=
C
.
DEFAULT_MODULE_NAME
,
module_args
=
C
.
DEFAULT_MODULE_ARGS
,
forks
=
C
.
DEFAULT_FORKS
,
timeout
=
C
.
DEFAULT_TIMEOUT
,
pattern
=
C
.
DEFAULT_PATTERN
,
remote_user
=
C
.
DEFAULT_REMOTE_USER
,
remote_pass
=
C
.
DEFAULT_REMOTE_PASS
,
background
=
0
,
basedir
=
None
,
setup_cache
=
None
,
transport
=
'paramiko'
,
conditional
=
'True'
,
groups
=
{},
callbacks
=
None
,
verbose
=
False
):
remote_port
=
C
.
DEFAULT_REMOTE_PORT
,
background
=
0
,
basedir
=
None
,
setup_cache
=
None
,
transport
=
'paramiko'
,
conditional
=
'True'
,
groups
=
{},
callbacks
=
None
,
verbose
=
False
):
if
setup_cache
is
None
:
setup_cache
=
{}
...
...
@@ -92,6 +92,7 @@ class Runner(object):
self
.
verbose
=
verbose
self
.
remote_user
=
remote_user
self
.
remote_pass
=
remote_pass
self
.
remote_port
=
remote_port
self
.
background
=
background
self
.
basedir
=
basedir
...
...
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