Bug fixes for GCP modules (#65597)

This commit is contained in:
The Magician 2020-01-03 12:35:59 -08:00 committed by ansibot
parent 528163ded2
commit 5bc11caa92
6 changed files with 5726 additions and 89 deletions

View file

@ -257,12 +257,6 @@ network:
- Only networks that are in the distributed mode can have subnetworks. - Only networks that are in the distributed mode can have subnetworks.
returned: success returned: success
type: dict type: dict
fingerprint:
description:
- Fingerprint of this resource. This field is used internally during updates of
this resource.
returned: success
type: str
secondaryIpRanges: secondaryIpRanges:
description: description:
- An array of configurations for secondary IP ranges for VM instances contained - An array of configurations for secondary IP ranges for VM instances contained
@ -375,7 +369,7 @@ def update_fields(module, request, response):
if response.get('ipCidrRange') != request.get('ipCidrRange'): if response.get('ipCidrRange') != request.get('ipCidrRange'):
ip_cidr_range_update(module, request, response) ip_cidr_range_update(module, request, response)
if response.get('secondaryIpRanges') != request.get('secondaryIpRanges'): if response.get('secondaryIpRanges') != request.get('secondaryIpRanges'):
fingerprint_update(module, request, response) secondary_ip_ranges_update(module, request, response)
if response.get('privateIpGoogleAccess') != request.get('privateIpGoogleAccess'): if response.get('privateIpGoogleAccess') != request.get('privateIpGoogleAccess'):
private_ip_google_access_update(module, request, response) private_ip_google_access_update(module, request, response)
@ -388,14 +382,11 @@ def ip_cidr_range_update(module, request, response):
) )
def fingerprint_update(module, request, response): def secondary_ip_ranges_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.patch( auth.patch(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/subnetworks/{name}"]).format(**module.params), ''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/subnetworks/{name}"]).format(**module.params),
{ {u'secondaryIpRanges': SubnetworkSecondaryiprangesArray(module.params.get('secondary_ip_ranges', []), module).to_request()},
u'fingerprint': response.get('fingerprint'),
u'secondaryIpRanges': SubnetworkSecondaryiprangesArray(module.params.get('secondary_ip_ranges', []), module).to_request(),
},
) )
@ -496,7 +487,6 @@ def response_to_hash(module, response):
u'ipCidrRange': response.get(u'ipCidrRange'), u'ipCidrRange': response.get(u'ipCidrRange'),
u'name': response.get(u'name'), u'name': response.get(u'name'),
u'network': replace_resource_dict(module.params.get(u'network', {}), 'selfLink'), u'network': replace_resource_dict(module.params.get(u'network', {}), 'selfLink'),
u'fingerprint': response.get(u'fingerprint'),
u'secondaryIpRanges': SubnetworkSecondaryiprangesArray(response.get(u'secondaryIpRanges', []), module).from_response(), u'secondaryIpRanges': SubnetworkSecondaryiprangesArray(response.get(u'secondaryIpRanges', []), module).from_response(),
u'privateIpGoogleAccess': response.get(u'privateIpGoogleAccess'), u'privateIpGoogleAccess': response.get(u'privateIpGoogleAccess'),
u'region': module.params.get('region'), u'region': module.params.get('region'),

View file

@ -164,12 +164,6 @@ resources:
- Only networks that are in the distributed mode can have subnetworks. - Only networks that are in the distributed mode can have subnetworks.
returned: success returned: success
type: dict type: dict
fingerprint:
description:
- Fingerprint of this resource. This field is used internally during updates
of this resource.
returned: success
type: str
secondaryIpRanges: secondaryIpRanges:
description: description:
- An array of configurations for secondary IP ranges for VM instances contained - An array of configurations for secondary IP ranges for VM instances contained

View file

@ -78,8 +78,7 @@ options:
ssl_certificates: ssl_certificates:
description: description:
- A list of SslCertificate resources that are used to authenticate connections - A list of SslCertificate resources that are used to authenticate connections
between users and the load balancer. Currently, exactly one SSL certificate between users and the load balancer. At least one SSL certificate must be specified.
must be specified.
required: true required: true
type: list type: list
ssl_policy: ssl_policy:
@ -290,7 +289,7 @@ quicOverride:
sslCertificates: sslCertificates:
description: description:
- A list of SslCertificate resources that are used to authenticate connections between - A list of SslCertificate resources that are used to authenticate connections between
users and the load balancer. Currently, exactly one SSL certificate must be specified. users and the load balancer. At least one SSL certificate must be specified.
returned: success returned: success
type: list type: list
sslPolicy: sslPolicy:

View file

@ -149,8 +149,8 @@ resources:
sslCertificates: sslCertificates:
description: description:
- A list of SslCertificate resources that are used to authenticate connections - A list of SslCertificate resources that are used to authenticate connections
between users and the load balancer. Currently, exactly one SSL certificate between users and the load balancer. At least one SSL certificate must be
must be specified. specified.
returned: success returned: success
type: list type: list
sslPolicy: sslPolicy:

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff