|
|
@ -174,8 +174,9 @@ def main():
|
|
|
|
module.fail_json(msg='Could not find security group %s' %
|
|
|
|
module.fail_json(msg='Could not find security group %s' %
|
|
|
|
security_group)
|
|
|
|
security_group)
|
|
|
|
|
|
|
|
|
|
|
|
if not _find_matching_rule(module, secgroup):
|
|
|
|
rule = _find_matching_rule(module, secgroup):
|
|
|
|
cloud.create_security_group_rule(
|
|
|
|
if not rule:
|
|
|
|
|
|
|
|
rule = cloud.create_security_group_rule(
|
|
|
|
secgroup['id'],
|
|
|
|
secgroup['id'],
|
|
|
|
port_range_min=module.params['port_range_min'],
|
|
|
|
port_range_min=module.params['port_range_min'],
|
|
|
|
port_range_max=module.params['port_range_max'],
|
|
|
|
port_range_max=module.params['port_range_max'],
|
|
|
@ -186,6 +187,7 @@ def main():
|
|
|
|
ethertype=module.params['ethertype']
|
|
|
|
ethertype=module.params['ethertype']
|
|
|
|
)
|
|
|
|
)
|
|
|
|
changed = True
|
|
|
|
changed = True
|
|
|
|
|
|
|
|
module.exit_json(changed=changed, rule=rule, id=rule.id)
|
|
|
|
|
|
|
|
|
|
|
|
if state == 'absent' and secgroup:
|
|
|
|
if state == 'absent' and secgroup:
|
|
|
|
rule = _find_matching_rule(module, secgroup)
|
|
|
|
rule = _find_matching_rule(module, secgroup)
|
|
|
|