cloudera.cluster.cm_license lookup – Get the details of a Cloudera license

Note

This lookup plugin is part of the cloudera.cluster collection (version 5.0.0).

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 cloudera.cluster. You need further requirements to be able to use this lookup plugin, see Requirements for details.

To use it in a playbook, specify: cloudera.cluster.cm_license.

New in cloudera.cluster 5.0.0

Synopsis

  • Parses and verifies the contents of a Cloudera license.

  • Returns the license details, including the computed password.

Requirements

The below requirements are needed on the local controller node that executes this lookup.

  • GnuPGP gpg executable

  • python-gnupg

Terms

Parameter

Comments

Terms

list / elements=path

Path to the license file.

Will raise an error if multiple paths are specified.

If no contents parameter is specified, the license file is read and parsed.

Keyword parameters

This describes keyword parameters of the lookup. These are the values key1=value1, key2=value2 and so on in the following examples: lookup('cloudera.cluster.cm_license', key1=value1, key2=value2, ...) and query('cloudera.cluster.cm_license', key1=value1, key2=value2, ...)

Parameter

Comments

contents

string

Contents of the license to parse.

verify

boolean

Flag whether to verify the license signature.

Choices:

  • false ← (default)

  • true

Notes

Note

  • When keyword and positional parameters are used together, positional parameters must be listed before keyword parameters: lookup('cloudera.cluster.cm_license', term1, term2, key1=value1, key2=value2) and query('cloudera.cluster.cm_license', term1, term2, key1=value1, key2=value2)

Examples

- name: Parse a Cloudera license file
  ansible.builtin.debug:
    msg: "{{ lookup('cm_license', '/path/to/license_file.txt') }}"

- name: Parse a Cloudera license file, but enable verification
  ansible.builtin.debug:
    msg: "{{ lookup('cm_license', '/path/to/license_file.txt', verify=True) }}"

- name: Parse Cloudera license content
  ansible.builtin.debug:
    msg: "{{ lookup('cm_license', contents=body) }}"
  vars:
    body: |
      -----BEGIN PGP SIGNED MESSAGE-----
      Hash: SHA256

      {
        <license content>
      }
      ----BEGIN PGP SIGNATURE-----
      <PGP signature>
      -----END PGP SIGNATURE-----

Return Value

Key

Description

Return value

dictionary

The contents of the license.

Returned: success

deactivation_date

string

Date of license deactivation.

Returned: always

expiration_date

string

Date of license expiration.

Returned: always

features

list / elements=string

List of enabled features.

Returned: when supported

name

string

Name of the license.

Returned: always

password

string

Computed password of the license.

Returned: always

start_date

string

Date of license activation.

Returned: always

uuid

string

Unique identifier of the license.

Returned: always

version

string

Version of the license.

Returned: always

Authors

  • Webster Mudge (@wmudge)

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.