netapp.storagegrid.na_sg_grid_self_signed_certificate module – Generate self signed certificate on StorageGRID.

Note

This module is part of the netapp.storagegrid collection (version 21.17.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install netapp.storagegrid.

To use it in a playbook, specify: netapp.storagegrid.na_sg_grid_self_signed_certificate.

New in netapp.storagegrid 21.17.0

Synopsis

  • Generate self signed certificate on NetApp StorageGRID.

Parameters

Parameter

Comments

api_url

string / required

The url to the StorageGRID Admin Node REST API.

auth_token

string / required

The authorization token for the API request

certificate_type

string

The type of self-signed certificate to be generated.

Choices:

  • "clientAuth"

  • "serverAuth" ← (default)

domains

list / elements=string

Domain name identities in addition to or in place of the identity in the subject field.

If the subject common name is not set, the first domain name in the list is used as the common name.

It is optional when certificate_type is clientAuth.

ips

list / elements=string

IP identities in addition to or in place of the identity in the subject field.

If subject common name and domains are not set, the first IP in the list is used as the common name.

It is optional when certificate_type is clientAuth.

key_usage_extension

boolean

Whether or not the generated certificate includes key usage extensions.

This should be set to true unless you are experiencing connection problems with older clients.

Choices:

  • false ← (default)

  • true

state

string

The self signed certificate should be present.

Choices:

  • "present" ← (default)

subject

string

The distinguished name of this certificate’s entity.

If the subject does not contain a CN value, the CN is set to /CN=[first domain or IP] if a domain or IP is present.

Otherwise, it is set to /CN=StorageGRID or /CN StorageGRID client, based on the extendedKeyUsage for the generated certificate.

valid_days

integer

The number of days the certificate is valid.

Default: 730

validate_certs

boolean

Should https certificates be validated?

Choices:

  • false

  • true ← (default)

Notes

Note

  • Module is not idempotent.

  • The modules prefixed with na_sg are built to manage NetApp StorageGRID.

Examples

- name: generate self signed certificate
  netapp.storagegrid.na_sg_grid_self_signed_certificate:
    api_url: "https://<storagegrid-endpoint-url>"
    auth_token: "storagegrid-auth-token"
    validate_certs: false
    subject: "/CN=StorageGRID"
    valid_days: 365
    domains:
      - storagegrid.example.com
    ips:
      - "1.2.3.4"
    certificate_type: "serverAuth"
    key_usage_extension: true

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

resp

dictionary

Returns information about the StorageGRID self signed certificate.

Returned: If state is ‘present’.

Sample: {"privateKeyEncoded": "<private key in PEM-encoding>", "serverCertificateEncoded": "<certificate in PEM-encoding>"}

Authors

  • NetApp Ansible Team (@vinaykus)