Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
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
edx
configuration
Commits
a4251275
Commit
a4251275
authored
Aug 26, 2013
by
Feanil Patel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the abilty to provide a config file for the proxy command.
parent
365c8e33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
util/vpc-tools/vpc-tools.py
+12
-6
No files found.
util/vpc-tools/vpc-tools.py
View file @
a4251275
"""VPC Tools.
Usage:
vpc-tools.py ssh-config vpc <vpc_id> identity-file <identity_file> user <user>
vpc-tools.py ssh-config vpc <vpc_id> identity-file <identity_file> user <user>
[config-file <config_file>]
vpc-tools.py (-h --help)
vpc-tools.py (-v --version)
...
...
@@ -27,7 +27,7 @@ JUMPBOX_CONFIG = """
HOST_CONFIG
=
"""
Host {name}
ProxyCommand ssh -W
%
h:
%
p {jump_box}
ProxyCommand ssh
{config_file}
-W
%
h:
%
p {jump_box}
HostName {ip}
IdentityFile {identity_file}
ForwardAgent yes
...
...
@@ -47,6 +47,11 @@ def _ssh_config(args):
identity_file
=
args
.
get
(
"<identity_file>"
)
user
=
args
.
get
(
"<user>"
,
DEFAULT_USER
)
vpc_id
=
args
.
get
(
"<vpc_id>"
)
config_file
=
args
.
get
(
"<config_file>"
)
if
config_file
:
config_file
=
"-F {}"
.
format
(
config_file
)
else
:
config_file
=
"nothing"
jump_box
=
"{vpc_id}-jumpbox"
.
format
(
vpc_id
=
vpc_id
)
friendly
=
"{vpc_id}-{logical_id}-{instance_id}"
...
...
@@ -74,7 +79,8 @@ def _ssh_config(args):
ip
=
instance
.
private_ip_address
,
user
=
user
,
logical_id
=
logical_id
,
identity_file
=
identity_file
)
identity_file
=
identity_file
,
config_file
=
config_file
)
#duplicating for convenience with ansible
name
=
friendly
.
format
(
vpc_id
=
vpc_id
,
...
...
@@ -87,9 +93,10 @@ def _ssh_config(args):
ip
=
instance
.
private_ip_address
,
user
=
user
,
logical_id
=
logical_id
,
identity_file
=
identity_file
)
identity_file
=
identity_file
,
config_file
=
config_file
)
if
__name__
==
'__main__'
:
args
=
docopt
(
__doc__
,
version
=
VERSION
)
dispatch
(
args
)
\ No newline at end of file
dispatch
(
args
)
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