diff options
author | Brian Coca <bcoca@ansible.com> | 2015-03-29 10:26:33 -0400 |
---|---|---|
committer | Brian Coca <bcoca@ansible.com> | 2015-03-29 10:26:33 -0400 |
commit | adfcfa4b5850cbc23b50f241a7cd51c38359df22 (patch) | |
tree | c282b23313bb88f7e324776c6094d0770700f98b | |
parent | feb5144c71200bc06c95a8eeb1ee37e048d40e5a (diff) | |
parent | 5e694c490cca727e1bf22a8f4358c48ca29ec59b (diff) | |
download | ansible-modules-core-adfcfa4b5850cbc23b50f241a7cd51c38359df22.tar.gz |
Merge pull request #318 from preo/ec2-group-empty-rules
Allow empty EC2 Security Group rules.
-rw-r--r-- | cloud/amazon/ec2_group.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cloud/amazon/ec2_group.py b/cloud/amazon/ec2_group.py index b502bd1d..5eb4317b 100644 --- a/cloud/amazon/ec2_group.py +++ b/cloud/amazon/ec2_group.py @@ -24,11 +24,15 @@ options: required: false rules: description: - - List of firewall inbound rules to enforce in this group (see example). + - List of firewall inbound rules to enforce in this group (see''' +''' example). If none are supplied, a default all-out rule is assumed.''' +''' If an empty list is supplied, no inbound rules will be enabled. required: false rules_egress: description: - - List of firewall outbound rules to enforce in this group (see example). + - List of firewall outbound rules to enforce in this group (see''' +''' example). If none are supplied, a default all-out rule is assumed.''' +''' If an empty list is supplied, no outbound rules will be enabled. required: false version_added: "1.6" region: @@ -277,7 +281,7 @@ def main(): addRulesToLookup(group.rules, 'in', groupRules) # Now, go through all provided rules and ensure they are there. - if rules: + if rules is not None: for rule in rules: group_id, ip, target_group_created = get_target_from_rule(module, ec2, rule, name, group, groups, vpc_id) if target_group_created: @@ -317,7 +321,7 @@ def main(): addRulesToLookup(group.rules_egress, 'out', groupRules) # Now, go through all provided rules and ensure they are there. - if rules_egress: + if rules_egress is not None: for rule in rules_egress: group_id, ip, target_group_created = get_target_from_rule(module, ec2, rule, name, group, groups, vpc_id) if target_group_created: |