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
8c8ff79c
Commit
8c8ff79c
authored
Mar 05, 2014
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added code to create tags on the VPC resource
parent
6dfafb0c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
library/cloud/ec2_vpc
+14
-0
No files found.
library/cloud/ec2_vpc
View file @
8c8ff79c
...
@@ -301,6 +301,20 @@ def create_vpc(module, vpc_conn):
...
@@ -301,6 +301,20 @@ def create_vpc(module, vpc_conn):
# Done with base VPC, now change to attributes and features.
# Done with base VPC, now change to attributes and features.
# Add resource tags
vpc_spec_tags
=
module
.
params
.
get
(
'resource_tags'
)
vpc_tags
=
dict
((
t
.
name
,
t
.
value
)
for
t
in
vpc_conn
.
get_all_tags
(
filters
=
{
'resource-id'
:
vpc
.
id
}))
if
not
set
(
vpc_spec_tags
.
items
())
.
issubset
(
set
(
vpc_tags
.
items
())):
new_tags
=
{}
for
(
key
,
value
)
in
set
(
vpc_spec_tags
.
items
()):
if
(
key
,
value
)
not
in
set
(
vpc_tags
.
items
()):
new_tags
[
key
]
=
value
if
new_tags
:
vpc_conn
.
create_tags
(
vpc
.
id
,
new_tags
)
# boto doesn't appear to have a way to determine the existing
# boto doesn't appear to have a way to determine the existing
# value of the dns attributes, so we just set them.
# value of the dns attributes, so we just set them.
...
...
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