ibm.ibm_zos_zosmf.zmf_authenticate (3.0.1) — module

Authenticate with z/OSMF server

| "added in version" 2.9 of ibm.ibm_zos_zosmf"

Authors: Yang Cao (@zosmf-Young), Yun Juan Yang (@zosmf-Robyn)

preview | supported by community

Install collection

Install with ansible-galaxy collection install ibm.ibm_zos_zosmf:==3.0.1


Add to requirements.yml

  collections:
    - name: ibm.ibm_zos_zosmf
      version: 3.0.1

Description

Authenticate with z/OSMF server by either username/password or HTTPS client authenticate.

Return the authentication credentials for successful authentication.

The credential can be then used for succeeding Ansible tasks which call z/OSMF Ansible module or role.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Authenticate with z/OSMF server by username/password
  zmf_authenticate:
    zmf_host: "sample.ibm.com"
    zmf_user: "your_username"
    zmf_password: "your_password"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Authenticate with z/OSMF server by HTTPS client authenticate
  zmf_authenticate:
    zmf_host: "sample.ibm.com"
    zmf_crt: "/file_with_your_certificate_chain.crt"
    zmf_key: "/file_with_your_private_key.key"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Authenticate with z/OSMF server by prompting to input the sensitive username/password when running the playbook
  vars_prompt:
    - name: zmf_user
      prompt: "Enter your zOSMF username"
      private: no
    - name: zmf_password
      prompt: "Enter your zOSMF password"
      private: yes
  tasks:
    - zmf_authenticate:
        zmf_host: "{{ zmf_host }}"
        zmf_port: "{{ zmf_port }}"
        zmf_user: "{{ zmf_user }}"
        zmf_password: "{{ zmf_password }}"

Inputs

    
zmf_crt:
    default: null
    description:
    - Location of the PEM-formatted certificate chain file to be used for HTTPS client
      authentication.
    - Required when I(zmf_user) and I(zmf_password) are not supplied.
    required: false
    type: str

zmf_key:
    default: null
    description:
    - Location of the PEM-formatted file with your private key to be used for HTTPS client
      authentication.
    - Required when I(zmf_user) and I(zmf_password) are not supplied.
    required: false
    type: str

zmf_host:
    description:
    - Hostname of the z/OSMF server.
    required: true
    type: str

zmf_port:
    default: null
    description:
    - Port number of the z/OSMF server.
    required: false
    type: int

zmf_user:
    default: null
    description:
    - User name to be used for authenticating with z/OSMF server.
    - Required when I(zmf_crt) and I(zmf_key) are not supplied.
    - If I(zmf_crt) and I(zmf_key) are supplied, I(zmf_user) and I(zmf_password) are ignored.
    required: false
    type: str

zmf_password:
    default: null
    description:
    - Password to be used for authenticating with z/OSMF server.
    - Required when I(zmf_crt) and I(zmf_key) are not supplied.
    - If I(zmf_crt) and I(zmf_key) are supplied, I(zmf_user) and I(zmf_password) are ignored.
    required: false
    type: str

Outputs

LtpaToken2:
  description: The value of Lightweight Third Party Access (LTPA) token, which supports
    strong encryption.
  returned: on success
  sample: yDS7uJxqrd3h8v5WXq9pf1yPtztQ4JzroZN3XQKF26ZicXgHc7mdzgycMCudvhxM+JWpC9TzhM4SEHRe/Vb3dC......
  type: str
changed:
  description: Indicates if any change is made during the module operation.
  returned: always
  type: bool
jwtToken:
  description: The value of JSON Web token, which supports strong encryption.
  returned: on success
  sample: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiQmVhcmVyIiwic3ViIjoiem9zbWZhZ.....
  type: str
zmf_host:
  description: Hostname of the z/OSMF server.
  returned: on success
  type: str
zmf_port:
  description: Port number of the z/OSMF server.
  returned: on success
  type: int