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
2ef65ae8
Commit
2ef65ae8
authored
Apr 24, 2014
by
James Martin
Committed by
James Cammarata
Apr 25, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ec2_elb_lb integration tests.
parent
ccd607be
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletions
+9
-1
test/integration/cleanup_ec2.py
+7
-0
test/integration/roles/test_ec2_elb_lb/defaults/main.yml
+2
-1
test/integration/roles/test_ec2_elb_lb/tasks/main.yml
+0
-0
No files found.
test/integration/cleanup_ec2.py
View file @
2ef65ae8
...
@@ -11,6 +11,7 @@ import boto
...
@@ -11,6 +11,7 @@ import boto
import
optparse
import
optparse
import
yaml
import
yaml
import
os.path
import
os.path
import
boto.ec2.elb
def
delete_aws_resources
(
get_func
,
attr
,
opts
):
def
delete_aws_resources
(
get_func
,
attr
,
opts
):
for
item
in
get_func
():
for
item
in
get_func
():
...
@@ -113,6 +114,9 @@ if __name__ == '__main__':
...
@@ -113,6 +114,9 @@ if __name__ == '__main__':
aws
=
boto
.
connect_ec2
(
aws_access_key_id
=
opts
.
ec2_access_key
,
aws
=
boto
.
connect_ec2
(
aws_access_key_id
=
opts
.
ec2_access_key
,
aws_secret_access_key
=
opts
.
ec2_secret_key
)
aws_secret_access_key
=
opts
.
ec2_secret_key
)
elb
=
boto
.
connect_elb
(
aws_access_key_id
=
opts
.
ec2_access_key
,
aws_secret_access_key
=
opts
.
ec2_secret_key
)
try
:
try
:
# Delete matching keys
# Delete matching keys
delete_aws_resources
(
aws
.
get_all_key_pairs
,
'name'
,
opts
)
delete_aws_resources
(
aws
.
get_all_key_pairs
,
'name'
,
opts
)
...
@@ -120,6 +124,9 @@ if __name__ == '__main__':
...
@@ -120,6 +124,9 @@ if __name__ == '__main__':
# Delete matching groups
# Delete matching groups
delete_aws_resources
(
aws
.
get_all_security_groups
,
'name'
,
opts
)
delete_aws_resources
(
aws
.
get_all_security_groups
,
'name'
,
opts
)
# Delete ELBs
delete_aws_resources
(
elb
.
get_all_load_balancers
,
'name'
,
opts
)
# Delete recorded EIPs
# Delete recorded EIPs
delete_aws_eips
(
aws
.
get_all_addresses
,
'public_ip'
,
opts
)
delete_aws_eips
(
aws
.
get_all_addresses
,
'public_ip'
,
opts
)
...
...
test/integration/roles/test_ec2_elb_lb/defaults/main.yml
View file @
2ef65ae8
---
---
# defaults file for test_ec2_elb_lb
# defaults file for test_ec2_eip
tag_prefix
:
'
{{resource_prefix}}'
test/integration/roles/test_ec2_elb_lb/tasks/main.yml
View file @
2ef65ae8
This diff is collapsed.
Click to expand it.
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