Bug fixes for GCP modules (#63605)

This commit is contained in:
The Magician 2019-10-21 11:46:21 -07:00 committed by ansibot
parent ce9e909a5b
commit e7b0050542
11 changed files with 96 additions and 55 deletions

View file

@ -316,6 +316,32 @@ options:
- 'Some valid choices include: "ONE_TO_ONE_NAT"'
required: true
type: str
set_public_ptr:
description:
- Specifies whether a public DNS PTR record should be created to map
the external IP address of the instance to a DNS domain name.
required: false
type: bool
version_added: '2.10'
public_ptr_domain_name:
description:
- The DNS domain name for the public PTR record. You can set this
field only if the setPublicPtr field is enabled.
required: false
type: str
version_added: '2.10'
network_tier:
description:
- This signifies the networking tier used for configuring this access
configuration. If an AccessConfig is specified without a valid external
IP address, an ephemeral IP will be created with this networkTier.
If an AccessConfig with a valid external IP address is specified,
it must match that of the networkTier associated with the Address
resource owning that IP.
- 'Some valid choices include: "PREMIUM", "STANDARD"'
required: false
type: str
version_added: '2.10'
alias_ip_ranges:
description:
- An array of alias IP ranges for this network interface. Can only be
@ -792,6 +818,28 @@ properties:
- The type of configuration. The default and only option is ONE_TO_ONE_NAT.
returned: success
type: str
setPublicPtr:
description:
- Specifies whether a public DNS PTR record should be created to map
the external IP address of the instance to a DNS domain name.
returned: success
type: bool
publicPtrDomainName:
description:
- The DNS domain name for the public PTR record. You can set this field
only if the setPublicPtr field is enabled.
returned: success
type: str
networkTier:
description:
- This signifies the networking tier used for configuring this access
configuration. If an AccessConfig is specified without a valid external
IP address, an ephemeral IP will be created with this networkTier.
If an AccessConfig with a valid external IP address is specified,
it must match that of the networkTier associated with the Address
resource owning that IP.
returned: success
type: str
aliasIpRanges:
description:
- An array of alias IP ranges for this network interface. Can only be specified
@ -980,7 +1028,14 @@ def main():
access_configs=dict(
type='list',
elements='dict',
options=dict(name=dict(required=True, type='str'), nat_ip=dict(type='dict'), type=dict(required=True, type='str')),
options=dict(
name=dict(required=True, type='str'),
nat_ip=dict(type='dict'),
type=dict(required=True, type='str'),
set_public_ptr=dict(type='bool'),
public_ptr_domain_name=dict(type='str'),
network_tier=dict(type='str'),
),
),
alias_ip_ranges=dict(
type='list', elements='dict', options=dict(ip_cidr_range=dict(type='str'), subnetwork_range_name=dict(type='str'))
@ -1483,11 +1538,27 @@ class InstanceTemplateAccessconfigsArray(object):
def _request_for_item(self, item):
return remove_nones_from_dict(
{u'name': item.get('name'), u'natIP': replace_resource_dict(item.get(u'nat_ip', {}), 'address'), u'type': item.get('type')}
{
u'name': item.get('name'),
u'natIP': replace_resource_dict(item.get(u'nat_ip', {}), 'address'),
u'type': item.get('type'),
u'setPublicPtr': item.get('set_public_ptr'),
u'publicPtrDomainName': item.get('public_ptr_domain_name'),
u'networkTier': item.get('network_tier'),
}
)
def _response_from_item(self, item):
return remove_nones_from_dict({u'name': item.get(u'name'), u'natIP': item.get(u'natIP'), u'type': item.get(u'type')})
return remove_nones_from_dict(
{
u'name': item.get(u'name'),
u'natIP': item.get(u'natIP'),
u'type': item.get(u'type'),
u'setPublicPtr': item.get(u'setPublicPtr'),
u'publicPtrDomainName': item.get(u'publicPtrDomainName'),
u'networkTier': item.get(u'networkTier'),
}
)
class InstanceTemplateAliasiprangesArray(object):

View file

@ -32,8 +32,6 @@ DOCUMENTATION = '''
module: gcp_compute_instance_template_info
description:
- Gather info for GCP InstanceTemplate
- This module was called C(gcp_compute_instance_template_facts) before Ansible 2.9.
The usage has not changed.
short_description: Gather info for GCP InstanceTemplate
version_added: '2.7'
author: Google Inc. (@googlecloudplatform)
@ -387,6 +385,28 @@ resources:
- The type of configuration. The default and only option is ONE_TO_ONE_NAT.
returned: success
type: str
setPublicPtr:
description:
- Specifies whether a public DNS PTR record should be created to
map the external IP address of the instance to a DNS domain name.
returned: success
type: bool
publicPtrDomainName:
description:
- The DNS domain name for the public PTR record. You can set this
field only if the setPublicPtr field is enabled.
returned: success
type: str
networkTier:
description:
- This signifies the networking tier used for configuring this access
configuration. If an AccessConfig is specified without a valid
external IP address, an ephemeral IP will be created with this
networkTier. If an AccessConfig with a valid external IP address
is specified, it must match that of the networkTier associated
with the Address resource owning that IP.
returned: success
type: str
aliasIpRanges:
description:
- An array of alias IP ranges for this network interface. Can only be
@ -529,9 +549,6 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
if module._name == 'gcp_compute_instance_template_facts':
module.deprecate("The 'gcp_compute_instance_template_facts' module has been renamed to 'gcp_compute_instance_template_info'", version='2.13')
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -32,8 +32,6 @@ DOCUMENTATION = '''
module: gcp_compute_interconnect_attachment_info
description:
- Gather info for GCP InterconnectAttachment
- This module was called C(gcp_compute_interconnect_attachment_facts) before Ansible
2.9. The usage has not changed.
short_description: Gather info for GCP InterconnectAttachment
version_added: '2.8'
author: Google Inc. (@googlecloudplatform)
@ -280,11 +278,6 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
if module._name == 'gcp_compute_interconnect_attachment_facts':
module.deprecate(
"The 'gcp_compute_interconnect_attachment_facts' module has been renamed to 'gcp_compute_interconnect_attachment_info'", version='2.13'
)
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -32,8 +32,6 @@ DOCUMENTATION = '''
module: gcp_compute_network_endpoint_group_info
description:
- Gather info for GCP NetworkEndpointGroup
- This module was called C(gcp_compute_network_endpoint_group_facts) before Ansible
2.9. The usage has not changed.
short_description: Gather info for GCP NetworkEndpointGroup
version_added: '2.10'
author: Google Inc. (@googlecloudplatform)
@ -189,9 +187,6 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')))
if module._name == 'gcp_compute_network_endpoint_group_facts':
module.deprecate("The 'gcp_compute_network_endpoint_group_facts' module has been renamed to 'gcp_compute_network_endpoint_group_info'", version='2.13')
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -32,8 +32,6 @@ DOCUMENTATION = '''
module: gcp_compute_network_info
description:
- Gather info for GCP Network
- This module was called C(gcp_compute_network_facts) before Ansible 2.9. The usage
has not changed.
short_description: Gather info for GCP Network
version_added: '2.7'
author: Google Inc. (@googlecloudplatform)
@ -203,9 +201,6 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
if module._name == 'gcp_compute_network_facts':
module.deprecate("The 'gcp_compute_network_facts' module has been renamed to 'gcp_compute_network_info'", version='2.13')
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -32,8 +32,6 @@ DOCUMENTATION = '''
module: gcp_compute_node_group_info
description:
- Gather info for GCP NodeGroup
- This module was called C(gcp_compute_node_group_facts) before Ansible 2.9. The usage
has not changed.
short_description: Gather info for GCP NodeGroup
version_added: '2.10'
author: Google Inc. (@googlecloudplatform)
@ -166,9 +164,6 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), zone=dict(required=True, type='str')))
if module._name == 'gcp_compute_node_group_facts':
module.deprecate("The 'gcp_compute_node_group_facts' module has been renamed to 'gcp_compute_node_group_info'", version='2.13')
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -32,8 +32,6 @@ DOCUMENTATION = '''
module: gcp_compute_node_template_info
description:
- Gather info for GCP NodeTemplate
- This module was called C(gcp_compute_node_template_facts) before Ansible 2.9. The
usage has not changed.
short_description: Gather info for GCP NodeTemplate
version_added: '2.10'
author: Google Inc. (@googlecloudplatform)
@ -190,9 +188,6 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
if module._name == 'gcp_compute_node_template_facts':
module.deprecate("The 'gcp_compute_node_template_facts' module has been renamed to 'gcp_compute_node_template_info'", version='2.13')
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -32,8 +32,6 @@ DOCUMENTATION = '''
module: gcp_compute_region_backend_service_info
description:
- Gather info for GCP RegionBackendService
- This module was called C(gcp_compute_region_backend_service_facts) before Ansible
2.9. The usage has not changed.
short_description: Gather info for GCP RegionBackendService
version_added: '2.10'
author: Google Inc. (@googlecloudplatform)
@ -230,9 +228,6 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(type='str')))
if module._name == 'gcp_compute_region_backend_service_facts':
module.deprecate("The 'gcp_compute_region_backend_service_facts' module has been renamed to 'gcp_compute_region_backend_service_info'", version='2.13')
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -32,8 +32,6 @@ DOCUMENTATION = '''
module: gcp_compute_region_disk_info
description:
- Gather info for GCP RegionDisk
- This module was called C(gcp_compute_region_disk_facts) before Ansible 2.9. The
usage has not changed.
short_description: Gather info for GCP RegionDisk
version_added: '2.8'
author: Google Inc. (@googlecloudplatform)
@ -289,9 +287,6 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
if module._name == 'gcp_compute_region_disk_facts':
module.deprecate("The 'gcp_compute_region_disk_facts' module has been renamed to 'gcp_compute_region_disk_info'", version='2.13')
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -32,8 +32,6 @@ DOCUMENTATION = '''
module: gcp_compute_route_info
description:
- Gather info for GCP Route
- This module was called C(gcp_compute_route_facts) before Ansible 2.9. The usage
has not changed.
short_description: Gather info for GCP Route
version_added: '2.7'
author: Google Inc. (@googlecloudplatform)
@ -203,9 +201,6 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
if module._name == 'gcp_compute_route_facts':
module.deprecate("The 'gcp_compute_route_facts' module has been renamed to 'gcp_compute_route_info'", version='2.13')
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

View file

@ -32,8 +32,6 @@ DOCUMENTATION = '''
module: gcp_compute_router_info
description:
- Gather info for GCP Router
- This module was called C(gcp_compute_router_facts) before Ansible 2.9. The usage
has not changed.
short_description: Gather info for GCP Router
version_added: '2.7'
author: Google Inc. (@googlecloudplatform)
@ -219,9 +217,6 @@ import json
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
if module._name == 'gcp_compute_router_facts':
module.deprecate("The 'gcp_compute_router_facts' module has been renamed to 'gcp_compute_router_info'", version='2.13')
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']