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
45965211
Commit
45965211
authored
Apr 24, 2014
by
Ben Holloway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attempt to set availability_zones to all if neither availability_zones or vpc_identifier are set
parent
5a39672e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
library/cloud/ec2_asg
+12
-4
No files found.
library/cloud/ec2_asg
View file @
45965211
...
@@ -39,8 +39,8 @@ options:
...
@@ -39,8 +39,8 @@ options:
required: false
required: false
availability_zones:
availability_zones:
description:
description:
- List of availability zone names in which to create the group.
- List of availability zone names in which to create the group.
Required if vpc_zone_identifier is not set.
required:
tru
e
required:
fals
e
launch_config_name:
launch_config_name:
description:
description:
- Name of the Launch configuration to use for the group. See the ec2_lc module for managing these.
- Name of the Launch configuration to use for the group. See the ec2_lc module for managing these.
...
@@ -102,7 +102,7 @@ def enforce_required_arguments(module):
...
@@ -102,7 +102,7 @@ def enforce_required_arguments(module):
they cannot be mandatory arguments for the module, so we enforce
they cannot be mandatory arguments for the module, so we enforce
them here '''
them here '''
missing_args
=
[]
missing_args
=
[]
for
arg
in
(
'min_size'
,
'max_size'
,
'launch_config_name'
,
'availability_zones'
):
for
arg
in
(
'min_size'
,
'max_size'
,
'launch_config_name'
):
if
module
.
params
[
arg
]
is
None
:
if
module
.
params
[
arg
]
is
None
:
missing_args
.
append
(
arg
)
missing_args
.
append
(
arg
)
if
missing_args
:
if
missing_args
:
...
@@ -122,9 +122,17 @@ def create_autoscaling_group(connection, module):
...
@@ -122,9 +122,17 @@ def create_autoscaling_group(connection, module):
vpc_zone_identifier
=
module
.
params
.
get
(
'vpc_zone_identifier'
)
vpc_zone_identifier
=
module
.
params
.
get
(
'vpc_zone_identifier'
)
launch_configs
=
connection
.
get_all_launch_configurations
(
names
=
[
launch_config_name
])
launch_configs
=
connection
.
get_all_launch_configurations
(
names
=
[
launch_config_name
])
as_groups
=
connection
.
get_all_groups
(
names
=
[
group_name
])
as_groups
=
connection
.
get_all_groups
(
names
=
[
group_name
])
if
not
vpc_zone_identifier
and
not
availability_zones
:
region
,
ec2_url
,
aws_connect_params
=
get_aws_connection_info
(
module
)
try
:
ec2_connection
=
connect_to_aws
(
boto
.
ec2
,
region
,
**
aws_connect_params
)
except
boto
.
exception
.
NoAuthHandlerFound
,
e
:
module
.
fail_json
(
msg
=
str
(
e
))
module
.
params
[
'availability_zones'
]
=
[
zone
.
name
for
zone
in
ec2_connection
.
get_all_zones
()]
if
not
as_groups
:
if
not
as_groups
:
ag
=
AutoScalingGroup
(
ag
=
AutoScalingGroup
(
group_name
=
group_name
,
group_name
=
group_name
,
...
...
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