Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Minor schema/docs update to SslCertificate. #89

Merged
merged 1 commit into from
Sep 12, 2018
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ansible/modules/cloud/google/gcp_compute_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ def response_to_hash(module, response):
def disk_type_selflink(name, params):
if name is None:
return
url = r"https://www.googleapis.com/compute/v1/projects/.*/zones/{zone}/diskTypes/[a-z1-9\-]*"
url = r"https://www.googleapis.com/compute/v1/projects/.*/zones/[a-z1-9\-]*/diskTypes/[a-z1-9\-]*"
if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/diskTypes/%s".format(**params) % name
return name
Expand Down
4 changes: 2 additions & 2 deletions lib/ansible/modules/cloud/google/gcp_compute_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ def response_to_hash(module, response):
def disk_type_selflink(name, params):
if name is None:
return
url = r"https://www.googleapis.com/compute/v1/projects/.*/zones/{zone}/diskTypes/[a-z1-9\-]*"
url = r"https://www.googleapis.com/compute/v1/projects/.*/zones/[a-z1-9\-]*/diskTypes/[a-z1-9\-]*"
if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/diskTypes/%s".format(**params) % name
return name
Expand All @@ -1060,7 +1060,7 @@ def disk_type_selflink(name, params):
def machine_type_selflink(name, params):
if name is None:
return
url = r"https://www.googleapis.com/compute/v1/projects/.*/zones/{zone}/machineTypes/[a-z1-9\-]*"
url = r"https://www.googleapis.com/compute/v1/projects/.*/zones/[a-z1-9\-]*/machineTypes/[a-z1-9\-]*"
if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/machineTypes/%s".format(**params) % name
return name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ def response_to_hash(module, response):
def disk_type_selflink(name, params):
if name is None:
return
url = r"https://www.googleapis.com/compute/v1/projects/.*/zones/{zone}/diskTypes/[a-z1-9\-]*"
url = r"https://www.googleapis.com/compute/v1/projects/.*/zones/[a-z1-9\-]*/diskTypes/[a-z1-9\-]*"
if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/diskTypes/%s".format(**params) % name
return name
Expand Down
23 changes: 13 additions & 10 deletions lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
---
module: gcp_compute_ssl_certificate
description:
- An SslCertificate resource. This resource provides a mechanism to upload an SSL
key and certificate to the load balancer to serve secure connections from the user.
- An SslCertificate resource, used for HTTPS load balancing. This resource provides
a mechanism to upload an SSL key and certificate to the load balancer to serve secure
connections from the user.
short_description: Creates a GCP SslCertificate
version_added: 2.6
author: Google Inc. (@googlecloudplatform)
Expand All @@ -52,7 +53,7 @@
- The certificate in PEM format.
- The certificate chain must be no greater than 5 certs long.
- The chain must include at least one intermediate cert.
required: false
required: true
description:
description:
- An optional description of this resource.
Expand All @@ -68,9 +69,12 @@
required: false
private_key:
description:
- The private key in PEM format.
required: false
- The write-only private key in PEM format.
required: true
extends_documentation_fragment: gcp
notes:
- "API Reference: U(https://cloud.google.com/compute/docs/reference/rest/v1/sslCertificates)"
- "Official Documentation: U(https://cloud.google.com/load-balancing/docs/ssl-certificates)"
'''

EXAMPLES = '''
Expand Down Expand Up @@ -143,7 +147,7 @@
type: str
private_key:
description:
- The private key in PEM format.
- The write-only private key in PEM format.
returned: success
type: str
'''
Expand All @@ -167,10 +171,10 @@ def main():
module = GcpModule(
argument_spec=dict(
state=dict(default='present', choices=['present', 'absent'], type='str'),
certificate=dict(type='str'),
certificate=dict(required=True, type='str'),
description=dict(type='str'),
name=dict(type='str'),
private_key=dict(type='str')
private_key=dict(required=True, type='str')
)
)

Expand Down Expand Up @@ -210,8 +214,7 @@ def create(module, link, kind):


def update(module, link, kind):
auth = GcpSession(module, 'compute')
return wait_for_operation(module, auth.put(link, resource_to_request(module)))
module.fail_json(msg="SslCertificate cannot be edited")


def delete(module, link, kind):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
type: str
private_key:
description:
- The private key in PEM format.
- The write-only private key in PEM format.
returned: success
type: str
'''
Expand Down