Added target_tags to gce_module.

pull/18777/head
Robert Marsa 10 years ago committed by Matt Clay
parent 9991e8d8f1
commit bf3cb32c1b

@ -66,6 +66,13 @@ options:
required: false required: false
default: null default: null
aliases: [] aliases: []
target_tags:
version_added: "1.9"
description:
- the target instance tags for creating a firewall rule
required: false
default: null
aliases: []
state: state:
description: description:
- desired state of the persistent disk - desired state of the persistent disk
@ -158,6 +165,7 @@ def main():
name = dict(), name = dict(),
src_range = dict(type='list'), src_range = dict(type='list'),
src_tags = dict(type='list'), src_tags = dict(type='list'),
target_tags = dict(type='list'),
state = dict(default='present'), state = dict(default='present'),
service_account_email = dict(), service_account_email = dict(),
pem_file = dict(), pem_file = dict(),
@ -173,6 +181,7 @@ def main():
name = module.params.get('name') name = module.params.get('name')
src_range = module.params.get('src_range') src_range = module.params.get('src_range')
src_tags = module.params.get('src_tags') src_tags = module.params.get('src_tags')
target_tags = module.params.get('target_tags')
state = module.params.get('state') state = module.params.get('state')
changed = False changed = False
@ -218,7 +227,7 @@ def main():
try: try:
gce.ex_create_firewall(fwname, allowed_list, network=name, gce.ex_create_firewall(fwname, allowed_list, network=name,
source_ranges=src_range, source_tags=src_tags) source_ranges=src_range, source_tags=src_tags, target_tags=target_tags)
changed = True changed = True
except ResourceExistsError: except ResourceExistsError:
pass pass
@ -229,6 +238,7 @@ def main():
json_output['allowed'] = allowed json_output['allowed'] = allowed
json_output['src_range'] = src_range json_output['src_range'] = src_range
json_output['src_tags'] = src_tags json_output['src_tags'] = src_tags
json_output['target_tags'] = target_tags
if state in ['absent', 'deleted']: if state in ['absent', 'deleted']:
if fwname: if fwname:

Loading…
Cancel
Save