Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add security group id option for ec2. #151

Merged
merged 2 commits into from
Dec 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ipa/ipa_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def __init__(self,
results_dir=None,
running_instance_id=None,
secret_access_key=None, # Not used in Azure
security_group_id=None, # Not used in Azure
service_account_file=None,
ssh_key_name=None, # Not used in Azure
ssh_private_key_file=None,
Expand Down
2 changes: 2 additions & 0 deletions ipa/ipa_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def test_image(provider_name,
results_dir=None,
running_instance_id=None,
secret_access_key=None,
security_group_id=None,
service_account_file=None,
ssh_key_name=None,
ssh_private_key_file=None,
Expand Down Expand Up @@ -101,6 +102,7 @@ def test_image(provider_name,
results_dir=results_dir,
running_instance_id=running_instance_id,
secret_access_key=secret_access_key,
security_group_id=security_group_id,
service_account_file=service_account_file,
ssh_key_name=ssh_key_name,
ssh_private_key_file=ssh_private_key_file,
Expand Down
8 changes: 8 additions & 0 deletions ipa/ipa_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def __init__(self,
results_dir=None,
running_instance_id=None,
secret_access_key=None,
security_group_id=None,
service_account_file=None, # Not used in EC2
ssh_key_name=None,
ssh_private_key_file=None,
Expand Down Expand Up @@ -124,6 +125,10 @@ def __init__(self,
secret_access_key or
self._get_from_ec2_config('secret_access_key')
)
self.security_group_id = (
security_group_id or
self._get_value('security_group_id')
)
self.ssh_key_name = (
ssh_key_name or
self._get_from_ec2_config('ssh_key_name')
Expand Down Expand Up @@ -269,6 +274,9 @@ def _launch_instance(self):
if self.subnet_id:
kwargs['ex_subnet'] = self._get_subnet(self.subnet_id)

if self.security_group_id:
kwargs['ex_security_group_ids'] = [self.security_group_id]

instance = self.compute_driver.create_node(**kwargs)

self.compute_driver.wait_until_running(
Expand Down
1 change: 1 addition & 0 deletions ipa/ipa_gce.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def __init__(self,
results_dir=None,
running_instance_id=None,
secret_access_key=None, # Not used in GCE
security_group_id=None, # Not used in GCE
service_account_file=None,
ssh_key_name=None, # Not used in GCE
ssh_private_key_file=None,
Expand Down
6 changes: 6 additions & 0 deletions ipa/scripts/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ def main(context, no_color):
'--secret-access-key',
help='EC2 secret access key for login credentials.'
)
@click.option(
'--security-group-id',
help='EC2 security group id to assign to instances VPC.'
)
@click.option(
'--service-account-file',
help='GCE service account file for login credentials.'
Expand Down Expand Up @@ -261,6 +265,7 @@ def test(context,
results_dir,
running_instance_id,
secret_access_key,
security_group_id,
service_account_file,
ssh_key_name,
ssh_private_key_file,
Expand Down Expand Up @@ -297,6 +302,7 @@ def test(context,
results_dir,
running_instance_id,
secret_access_key,
security_group_id,
service_account_file,
ssh_key_name,
ssh_private_key_file,
Expand Down
2 changes: 1 addition & 1 deletion man/man1/ipa-list.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "IPA LIST" "1" "15-Aug-2018" "" "ipa list Manual"
.TH "IPA LIST" "1" "06-Dec-2018" "2.3.0" "ipa list Manual"
.SH NAME
ipa\-list \- Print a list of test files or test cases.
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion man/man1/ipa-results-archive.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "IPA RESULTS ARCHIVE" "1" "15-Aug-2018" "" "ipa results archive Manual"
.TH "IPA RESULTS ARCHIVE" "1" "06-Dec-2018" "2.3.0" "ipa results archive Manual"
.SH NAME
ipa\-results\-archive \- Archive the history log and all results/log...
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion man/man1/ipa-results-clear.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "IPA RESULTS CLEAR" "1" "15-Aug-2018" "" "ipa results clear Manual"
.TH "IPA RESULTS CLEAR" "1" "06-Dec-2018" "2.3.0" "ipa results clear Manual"
.SH NAME
ipa\-results\-clear \- Clear the results from the history file.
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion man/man1/ipa-results-delete.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "IPA RESULTS DELETE" "1" "15-Aug-2018" "" "ipa results delete Manual"
.TH "IPA RESULTS DELETE" "1" "06-Dec-2018" "2.3.0" "ipa results delete Manual"
.SH NAME
ipa\-results\-delete \- Delete the specified history item from the...
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion man/man1/ipa-results-list.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "IPA RESULTS LIST" "1" "15-Aug-2018" "" "ipa results list Manual"
.TH "IPA RESULTS LIST" "1" "06-Dec-2018" "2.3.0" "ipa results list Manual"
.SH NAME
ipa\-results\-list \- Display list of results history.
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion man/man1/ipa-results-show.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "IPA RESULTS SHOW" "1" "15-Aug-2018" "" "ipa results show Manual"
.TH "IPA RESULTS SHOW" "1" "06-Dec-2018" "2.3.0" "ipa results show Manual"
.SH NAME
ipa\-results\-show \- Print test results info from provided results...
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion man/man1/ipa-results.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "IPA RESULTS" "1" "15-Aug-2018" "" "ipa results Manual"
.TH "IPA RESULTS" "1" "06-Dec-2018" "2.3.0" "ipa results Manual"
.SH NAME
ipa\-results \- Process provided history log and results...
.SH SYNOPSIS
Expand Down
8 changes: 7 additions & 1 deletion man/man1/ipa-test.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "IPA TEST" "1" "15-Aug-2018" "" "ipa test Manual"
.TH "IPA TEST" "1" "06-Dec-2018" "2.3.0" "ipa test Manual"
.SH NAME
ipa\-test \- Test image in the given framework using the...
.SH SYNOPSIS
Expand All @@ -8,6 +8,9 @@ ipa\-test \- Test image in the given framework using the...
Test image in the given framework using the supplied test files.
.SH OPTIONS
.TP
\fB\-\-accelerated\-networking\fP
Enable accelerated networking in Azure instance network interface.
.TP
\fB\-\-access\-key\-id\fP TEXT
EC2 access key ID for login credentials.
.TP
Expand Down Expand Up @@ -71,6 +74,9 @@ The ID or Name of running instance to test.
\fB\-\-secret\-access\-key\fP TEXT
EC2 secret access key for login credentials.
.TP
\fB\-\-security\-group\-id\fP TEXT
EC2 security group id to assign to instances VPC.
.TP
\fB\-\-service\-account\-file\fP TEXT
GCE service account file for login credentials.
.TP
Expand Down
2 changes: 1 addition & 1 deletion man/man1/ipa.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "IPA" "1" "15-Aug-2018" "" "ipa Manual"
.TH "IPA" "1" "06-Dec-2018" "2.3.0" "ipa Manual"
.SH NAME
ipa \- Ipa provides a Python API and command line...
.SH SYNOPSIS
Expand Down