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) #63604

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
5 changes: 0 additions & 5 deletions lib/ansible/modules/cloud/google/gcp_compute_disk_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
module: gcp_compute_disk_info
description:
- Gather info for GCP Disk
- This module was called C(gcp_compute_disk_facts) before Ansible 2.9. The usage has
not changed.
short_description: Gather info for GCP Disk
version_added: '2.7'
author: Google Inc. (@googlecloudplatform)
Expand Down Expand Up @@ -343,9 +341,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_disk_facts':
module.deprecate("The 'gcp_compute_disk_facts' module has been renamed to 'gcp_compute_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_firewall_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
module: gcp_compute_firewall_info
description:
- Gather info for GCP Firewall
- This module was called C(gcp_compute_firewall_facts) before Ansible 2.9. The usage
has not changed.
short_description: Gather info for GCP Firewall
version_added: '2.7'
author: Google Inc. (@googlecloudplatform)
Expand Down Expand Up @@ -299,9 +297,6 @@
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))

if module._name == 'gcp_compute_firewall_facts':
module.deprecate("The 'gcp_compute_firewall_facts' module has been renamed to 'gcp_compute_firewall_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_forwarding_rule_info
description:
- Gather info for GCP ForwardingRule
- This module was called C(gcp_compute_forwarding_rule_facts) before Ansible 2.9.
The usage has not changed.
short_description: Gather info for GCP ForwardingRule
version_added: '2.7'
author: Google Inc. (@googlecloudplatform)
Expand Down Expand Up @@ -301,9 +299,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_forwarding_rule_facts':
module.deprecate("The 'gcp_compute_forwarding_rule_facts' module has been renamed to 'gcp_compute_forwarding_rule_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_global_address_info
description:
- Gather info for GCP GlobalAddress
- This module was called C(gcp_compute_global_address_facts) before Ansible 2.9. The
usage has not changed.
short_description: Gather info for GCP GlobalAddress
version_added: '2.7'
author: Google Inc. (@googlecloudplatform)
Expand Down Expand Up @@ -200,9 +198,6 @@
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))

if module._name == 'gcp_compute_global_address_facts':
module.deprecate("The 'gcp_compute_global_address_facts' module has been renamed to 'gcp_compute_global_address_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_global_forwarding_rule_info
description:
- Gather info for GCP GlobalForwardingRule
- This module was called C(gcp_compute_global_forwarding_rule_facts) before Ansible
2.9. The usage has not changed.
short_description: Gather info for GCP GlobalForwardingRule
version_added: '2.7'
author: Google Inc. (@googlecloudplatform)
Expand Down Expand Up @@ -280,9 +278,6 @@
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))

if module._name == 'gcp_compute_global_forwarding_rule_facts':
module.deprecate("The 'gcp_compute_global_forwarding_rule_facts' module has been renamed to 'gcp_compute_global_forwarding_rule_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_health_check_info
description:
- Gather info for GCP HealthCheck
- This module was called C(gcp_compute_health_check_facts) before Ansible 2.9. The
usage has not changed.
short_description: Gather info for GCP HealthCheck
version_added: '2.7'
author: Google Inc. (@googlecloudplatform)
Expand Down Expand Up @@ -468,9 +466,6 @@
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))

if module._name == 'gcp_compute_health_check_facts':
module.deprecate("The 'gcp_compute_health_check_facts' module has been renamed to 'gcp_compute_health_check_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_http_health_check_info
description:
- Gather info for GCP HttpHealthCheck
- This module was called C(gcp_compute_http_health_check_facts) before Ansible 2.9.
The usage has not changed.
short_description: Gather info for GCP HttpHealthCheck
version_added: '2.7'
author: Google Inc. (@googlecloudplatform)
Expand Down Expand Up @@ -200,9 +198,6 @@
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))

if module._name == 'gcp_compute_http_health_check_facts':
module.deprecate("The 'gcp_compute_http_health_check_facts' module has been renamed to 'gcp_compute_http_health_check_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_https_health_check_info
description:
- Gather info for GCP HttpsHealthCheck
- This module was called C(gcp_compute_https_health_check_facts) before Ansible 2.9.
The usage has not changed.
short_description: Gather info for GCP HttpsHealthCheck
version_added: '2.7'
author: Google Inc. (@googlecloudplatform)
Expand Down Expand Up @@ -200,9 +198,6 @@
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))

if module._name == 'gcp_compute_https_health_check_facts':
module.deprecate("The 'gcp_compute_https_health_check_facts' module has been renamed to 'gcp_compute_https_health_check_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_image_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
module: gcp_compute_image_info
description:
- Gather info for GCP Image
- This module was called C(gcp_compute_image_facts) before Ansible 2.9. The usage
has not changed.
short_description: Gather info for GCP Image
version_added: '2.7'
author: Google Inc. (@googlecloudplatform)
Expand Down Expand Up @@ -331,9 +329,6 @@
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))

if module._name == 'gcp_compute_image_facts':
module.deprecate("The 'gcp_compute_image_facts' module has been renamed to 'gcp_compute_image_info'", version='2.13')

if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

Expand Down
76 changes: 73 additions & 3 deletions lib/ansible/modules/cloud/google/gcp_compute_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,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 specified
Expand Down Expand Up @@ -841,6 +867,27 @@
- 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 @@ -1062,7 +1109,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'))),
network=dict(type='dict'),
Expand Down Expand Up @@ -1641,11 +1695,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 InstanceAliasiprangesArray(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
module: gcp_compute_instance_group_info
description:
- Gather info for GCP InstanceGroup
- This module was called C(gcp_compute_instance_group_facts) before Ansible 2.9. The
usage has not changed.
short_description: Gather info for GCP InstanceGroup
version_added: '2.7'
author: Google Inc. (@googlecloudplatform)
Expand Down Expand Up @@ -209,9 +207,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_instance_group_facts':
module.deprecate("The 'gcp_compute_instance_group_facts' module has been renamed to 'gcp_compute_instance_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_instance_group_manager_info
description:
- Gather info for GCP InstanceGroupManager
- This module was called C(gcp_compute_instance_group_manager_facts) before Ansible
2.9. The usage has not changed.
short_description: Gather info for GCP InstanceGroupManager
version_added: '2.7'
author: Google Inc. (@googlecloudplatform)
Expand Down Expand Up @@ -284,9 +282,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_instance_group_manager_facts':
module.deprecate("The 'gcp_compute_instance_group_manager_facts' module has been renamed to 'gcp_compute_instance_group_manager_info'", version='2.13')

if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

Expand Down
27 changes: 22 additions & 5 deletions lib/ansible/modules/cloud/google/gcp_compute_instance_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
module: gcp_compute_instance_info
description:
- Gather info for GCP Instance
- This module was called C(gcp_compute_instance_facts) before Ansible 2.9. The usage
has not changed.
short_description: Gather info for GCP Instance
version_added: '2.7'
author: Google Inc. (@googlecloudplatform)
Expand Down Expand Up @@ -395,6 +393,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 @@ -571,9 +591,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_instance_facts':
module.deprecate("The 'gcp_compute_instance_facts' module has been renamed to 'gcp_compute_instance_info'", version='2.13')

if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']

Expand Down