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
b30ddc45
Commit
b30ddc45
authored
Mar 28, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose remote_port option in playbook
parent
a05b75db
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
bin/ansible
+1
-0
bin/ansible-playbook
+4
-0
lib/ansible/playbook.py
+10
-8
No files found.
bin/ansible
View file @
b30ddc45
...
...
@@ -75,6 +75,7 @@ class Cli(object):
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
...
...
bin/ansible-playbook
View file @
b30ddc45
...
...
@@ -43,6 +43,9 @@ def main(args):
help
=
"path to module library"
,
default
=
C
.
DEFAULT_MODULE_PATH
)
parser
.
add_option
(
'-O'
,
'--override-hosts'
,
dest
=
"override_hosts"
,
default
=
None
,
help
=
"run playbook against these hosts regardless of inventory settings"
)
parser
.
add_option
(
'-p'
,
'--port'
,
default
=
C
.
DEFAULT_REMOTE_PORT
,
type
=
'int'
,
dest
=
'remote_port'
,
help
=
'set the remote ssh port'
)
parser
.
add_option
(
'-T'
,
'--timeout'
,
default
=
C
.
DEFAULT_TIMEOUT
,
type
=
'int'
,
dest
=
'timeout'
,
help
=
"set the SSH timeout in seconds"
)
...
...
@@ -73,6 +76,7 @@ def main(args):
forks
=
options
.
forks
,
verbose
=
True
,
remote_pass
=
sshpass
,
remote_port
=
options
.
remote_port
,
callbacks
=
playbook_cb
,
runner_callbacks
=
runner_cb
,
stats
=
stats
,
...
...
lib/ansible/playbook.py
View file @
b30ddc45
...
...
@@ -255,7 +255,7 @@ class PlayBook(object):
# *****************************************************
def
_run_module
(
self
,
pattern
,
host_list
,
module
,
args
,
remote_user
,
remote_port
,
async_seconds
,
async_poll_interval
,
only_if
):
async_seconds
,
async_poll_interval
,
only_if
):
''' run a particular module step in a playbook '''
hosts
=
[
h
for
h
in
host_list
if
(
h
not
in
self
.
stats
.
failures
)
and
(
h
not
in
self
.
stats
.
dark
)]
...
...
@@ -264,7 +264,8 @@ 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
,
remote_port
=
remote_port
,
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
,
)
...
...
@@ -277,7 +278,7 @@ class PlayBook(object):
# *****************************************************
def
_run_task
(
self
,
pattern
=
None
,
host_list
=
None
,
task
=
None
,
remote_user
=
None
,
remote_port
=
None
,
handlers
=
None
,
conditional
=
False
):
remote_user
=
None
,
handlers
=
None
,
conditional
=
False
):
''' run a single task in the playbook and recursively run any subtasks. '''
# load the module name and parameters from the task entry
...
...
@@ -305,7 +306,8 @@ class PlayBook(object):
# load up an appropriate ansible runner to
# run the task in parallel
results
=
self
.
_run_module
(
pattern
,
host_list
,
module_name
,
module_args
,
remote_user
,
remote_port
,
async_seconds
,
async_poll_interval
,
only_if
)
module_args
,
remote_user
,
async_seconds
,
async_poll_interval
,
only_if
)
self
.
stats
.
compute
(
results
)
...
...
@@ -427,8 +429,9 @@ 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
,
remote_port
=
port
,
remote_pass
=
self
.
remote_pass
,
setup_cache
=
SETUP_CACHE
,
timeout
=
self
.
timeout
,
remote_user
=
user
,
remote_pass
=
self
.
remote_pass
,
remote_port
=
self
.
remote_port
,
setup_cache
=
SETUP_CACHE
,
callbacks
=
self
.
runner_callbacks
,
)
.
run
()
self
.
stats
.
compute
(
setup_results
,
setup
=
True
)
...
...
@@ -479,7 +482,6 @@ class PlayBook(object):
task
=
task
,
handlers
=
handlers
,
remote_user
=
user
,
remote_port
=
port
)
# handlers only run on certain nodes, they are flagged by _flag_handlers
...
...
@@ -498,7 +500,7 @@ class PlayBook(object):
host_list
=
triggered_by
,
conditional
=
True
,
remote_user
=
user
,
remote_port
=
port
remote_port
=
self
.
remote_
port
)
# end of execution for this particular pattern. Multiple patterns
...
...
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