sap.sap_operations.saplikey (1.25.0) — module

Manage sap license keys for SAP application instance with saplikey program.

| "added in version" 1.8.0-galaxy of sap.sap_operations"

Authors: Kirill Satarin (@kksat)

Install collection

Install with ansible-galaxy collection install sap.sap_operations:==1.25.0


Add to requirements.yml

  collections:
    - name: sap.sap_operations
      version: 1.25.0

Description

Either O(filename) or O(license_content) should be provided. Filename is a path on the target host where license file is located.

If O(license_content) provided, it will be copied to temporary local file and then used for installation. File deleted afterwards.

If state is C(absent), O(system), O(hardware_key) and O(product) parameters are required.

In order to use asterisk as a wildcard in O(system), O(hardware_key) and O(product) parameters, set O(allow_asterisk) to true. This is to prevent accidental deletion of licenses.

Manage sap license keys for SAP application instance with saplikey program.

Uses saplikey program to get information about SAP license keys and manage them.

saplikey program is a part of SAP kernel


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

- name: Ensure license keys absent (with asterisks)
  sap.sap_operations.saplikey:
    state: absent
    system: '*'
    hardware_key: '*'
    product: NetWeaver_SYB
    allow_asterisk: true
  become: true
  become_user: <sid>adm
  become_flags: '-i'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure license key present
  sap.sap_operations.saplikey:
    license_content: |
      ----- Begin SAP License -----
  become: true
  become_user: <sid>adm
  become_flags: '-i'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure license key absent that does not exists
  sap.sap_operations.saplikey:
    state: absent
    system: AAA
    hardware_key: doesnotexists
    product: doesnotexists
  become: true
  become_user: <sid>adm
  become_flags: '-i'

Inputs

    
state:
    choices:
    - present
    - absent
    default: present
    description:
    - Whether the license should be present or absent.
    required: false
    type: str

system:
    aliases:
    - sid
    - system_id
    description:
    - The system ID of the SAP system.
    - Or a wildcard asterisk C(*).
    required: false
    type: str

product:
    description:
    - The product ID of the SAP system.
    required: false
    type: str

profile:
    default: DEFAULT.PFL
    description: Profile filename as mentioned in SAP documentation for saplikey program.
    required: false
    type: path

filename:
    description:
    - Path to the license file to install or remove.
    required: false
    type: path

hardware_key:
    description:
    - The hardware key of the SAP system.
    required: false
    type: str

allow_asterisk:
    default: false
    description:
    - Whether to allow the use of asterisks as wildcards in the system, hardware_key,
      and product parameters.
    - This is to prevent accidental deletion of licenses.
    required: false
    type: bool

license_content:
    description:
    - The content of the license file to install or remove.
    - This parameter is not logged.
    required: false
    type: str

Outputs

license_keys:
  description:
  - The list of installed license keys.
  - Please pay attention that all dates are in format YYYYMMDD.
  - Please pay attention that all numeric values are returned as strings.
  elements: dict
  returned: always
  sample:
  - begin_of_validity: '20230111'
    end_of_validity: '20240712'
    hardware_key: D1111111111
    installation_number: '0000000000'
    last_successful_check: '20231016'
    software_product: NetWeaver_SYB
    software_product_limit: '2000000000'
    system_id: AAA
    system_number: '000000000000000000'
    type_of_license_key: permanent
    validity: valid
  - begin_of_validity: '20230111'
    end_of_validity: '20240712'
    hardware_key: D1111111111
    installation_number: '0000000000'
    last_successful_check: '00000000'
    software_product: Maintenance_SYB
    software_product_limit: '2000000000'
    system_id: AAA
    system_number: '000000000000000000'
    type_of_license_key: permanent
    validity: valid
  type: list
rc:
  description: Return code of the saplikey program execution.
  returned: always
  sample: 0
  type: int
stderr:
  description: The standard error of the saplikey program execution.
  returned: always
  sample: ''
  type: str
stdout:
  description: The standard output of the saplikey program execution.
  returned: always
  sample: 'SAP License Key Administration  -  Copyright (C) 2003 - 2012 SAP AG


    1 SAP license key(s) successfully installed.

    '
  type: str

See also