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
2084629d
Commit
2084629d
authored
Aug 08, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7410 from willthames/ec2_vol_fix_error_check
Fix parameters check for ec2_vol
parents
1328ecec
551adfa2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
library/cloud/ec2_vol
+9
-3
No files found.
library/cloud/ec2_vol
View file @
2084629d
...
...
@@ -325,9 +325,6 @@ def main():
if
id
and
name
:
module
.
fail_json
(
msg
=
"Both id and name cannot be specified"
)
if
not
(
id
or
name
or
volume_size
):
module
.
fail_json
(
msg
=
"Cannot specify volume_size and either one of name or id"
)
# Here we need to get the zone info for the instance. This covers situation where
# instance is specified but zone isn't.
# Useful for playbooks chaining instance launch with volume create + attach and where the
...
...
@@ -345,6 +342,15 @@ def main():
device
=
device_name
,
changed
=
False
)
# Delaying the checks until after the instance check allows us to get volume ids for existing volumes
# without needing to pass an unused volume_size
if
not
volume_size
and
not
(
id
or
name
):
module
.
fail_json
(
msg
=
"You must specify an existing volume with id or name or a volume_size"
)
if
volume_size
and
(
id
or
name
):
module
.
fail_json
(
msg
=
"Cannot specify volume_size and either one of name or id"
)
if
state
==
'absent'
:
delete_volume
(
module
,
ec2
)
else
:
...
...
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