Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes for GCP (as of 2019-10-17T06:05:58Z) #63605

Merged
merged 1 commit into from
Oct 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
77 changes: 74 additions & 3 deletions lib/ansible/modules/cloud/google/gcp_compute_instance_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,32 @@
- '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
Expand Down Expand Up @@ -792,6 +818,28 @@
- 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
Expand Down Expand Up @@ -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'))
Expand Down Expand Up @@ -1483,11 +1538,27 @@ def from_response(self):

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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
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)
Expand Down Expand Up @@ -387,6 +385,28 @@
- 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
Expand Down Expand Up @@ -529,9 +549,6 @@
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']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
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)
Expand Down Expand Up @@ -280,11 +278,6 @@
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']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
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)
Expand Down Expand Up @@ -189,9 +187,6 @@
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']

Expand Down
5 changes: 0 additions & 5 deletions lib/ansible/modules/cloud/google/gcp_compute_network_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
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)
Expand Down Expand Up @@ -203,9 +201,6 @@
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']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
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)
Expand Down Expand Up @@ -166,9 +164,6 @@
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']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
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)
Expand Down Expand Up @@ -190,9 +188,6 @@
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']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
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)
Expand Down Expand Up @@ -230,9 +228,6 @@
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']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
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)
Expand Down Expand Up @@ -289,9 +287,6 @@
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']

Expand Down
5 changes: 0 additions & 5 deletions lib/ansible/modules/cloud/google/gcp_compute_route_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
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)
Expand Down Expand Up @@ -203,9 +201,6 @@
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']

Expand Down
5 changes: 0 additions & 5 deletions lib/ansible/modules/cloud/google/gcp_compute_router_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
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)
Expand Down Expand Up @@ -219,9 +217,6 @@
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']

Expand Down