Added the ability to set an instance to forward ip.

pull/18777/head
Robert Marsa 10 years ago committed by Matt Clay
parent 90f5a23f34
commit 4737b41f26

@ -115,6 +115,13 @@ options:
required: true required: true
default: "us-central1-a" default: "us-central1-a"
aliases: [] aliases: []
ip_forward:
version_added: "1.9"
description:
- set to true if the instance can forward ip packets (useful for gateways)
required: false
default: "false"
aliases: []
requirements: [ "libcloud" ] requirements: [ "libcloud" ]
notes: notes:
@ -259,6 +266,7 @@ def create_instances(module, gce, instance_names):
state = module.params.get('state') state = module.params.get('state')
tags = module.params.get('tags') tags = module.params.get('tags')
zone = module.params.get('zone') zone = module.params.get('zone')
ip_forward = module.params.get('ip_forward')
new_instances = [] new_instances = []
changed = False changed = False
@ -319,7 +327,7 @@ def create_instances(module, gce, instance_names):
try: try:
inst = gce.create_node(name, lc_machine_type, lc_image, inst = gce.create_node(name, lc_machine_type, lc_image,
location=lc_zone, ex_network=network, ex_tags=tags, location=lc_zone, ex_network=network, ex_tags=tags,
ex_metadata=metadata, ex_boot_disk=pd) ex_metadata=metadata, ex_boot_disk=pd, ex_can_ip_forward=ip_forward)
changed = True changed = True
except ResourceExistsError: except ResourceExistsError:
inst = gce.ex_get_node(name, lc_zone) inst = gce.ex_get_node(name, lc_zone)
@ -409,6 +417,7 @@ def main():
service_account_email = dict(), service_account_email = dict(),
pem_file = dict(), pem_file = dict(),
project_id = dict(), project_id = dict(),
ip_forward = dict(type='bool', default=False),
) )
) )
@ -424,6 +433,7 @@ def main():
state = module.params.get('state') state = module.params.get('state')
tags = module.params.get('tags') tags = module.params.get('tags')
zone = module.params.get('zone') zone = module.params.get('zone')
ip_forward = module.params.get('ip_forward')
changed = False changed = False
inames = [] inames = []

Loading…
Cancel
Save