From ea1122d49f84ab4f43637d3770bfe61dce7eb6f9 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. --- cloud/google/gce_net.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cloud/google/gce_net.py b/cloud/google/gce_net.py index 10592d20033..bafe6d1d43a 100644 --- a/cloud/google/gce_net.py +++ b/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: