From bf3cb32c1b7fccffb77f45cf49e32b05377ed07c Mon Sep 17 00:00:00 2001 From: Robert Marsa Date: Thu, 12 Feb 2015 09:27:39 -0800 Subject: [PATCH] Added target_tags to gce_module. --- lib/ansible/modules/cloud/google/gce_net.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/google/gce_net.py b/lib/ansible/modules/cloud/google/gce_net.py index 10592d20033..bafe6d1d43a 100644 --- a/lib/ansible/modules/cloud/google/gce_net.py +++ b/lib/ansible/modules/cloud/google/gce_net.py @@ -66,6 +66,13 @@ options: required: false default: null aliases: [] + target_tags: + version_added: "1.9" + description: + - the target instance tags for creating a firewall rule + required: false + default: null + aliases: [] state: description: - desired state of the persistent disk @@ -158,6 +165,7 @@ def main(): name = dict(), src_range = dict(type='list'), src_tags = dict(type='list'), + target_tags = dict(type='list'), state = dict(default='present'), service_account_email = dict(), pem_file = dict(), @@ -173,6 +181,7 @@ def main(): name = module.params.get('name') src_range = module.params.get('src_range') src_tags = module.params.get('src_tags') + target_tags = module.params.get('target_tags') state = module.params.get('state') changed = False @@ -218,7 +227,7 @@ def main(): try: 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 except ResourceExistsError: pass @@ -229,6 +238,7 @@ def main(): json_output['allowed'] = allowed json_output['src_range'] = src_range json_output['src_tags'] = src_tags + json_output['target_tags'] = target_tags if state in ['absent', 'deleted']: if fwname: