ziouf.tpm.password (2021.7.27-1070151628) — lookup

Retrieve password values

| "added in version" 2.10.4 of ziouf.tpm"

Authors: Cyril Marin (@ziouf)

Install collection

Install with ansible-galaxy collection install ziouf.tpm:==2021.7.27-1070151628


Add to requirements.yml

  collections:
    - name: ziouf.tpm
      version: 2021.7.27-1070151628

Description

Retrieve password values

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# First matching result
- debug: msg="{{ lookup('ziouf.tpm.password', 'username:admin tag:nexus,prd') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# returns : dict
- debug: msg="{{ query('ziouf.tpm.password', 'username:admin tag:nexus,prd') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# returns : dict
- debug: msg="{{ lookup('ziouf.tpm.password', 'username:admin tag:nexus,prd', field='password') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# returns : str
- debug: msg="{{ query('ziouf.tpm.password', 'username:admin tag:nexus,prd', field='password') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# returns : str

# All matching results
- debug: msg="{{ lookup('ziouf.tpm.password', 'username:admin tag:nexus,prd', all=True) }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# returns : [dict, ...]
- debug: msg="{{ query('ziouf.tpm.password', 'username:admin tag:nexus,prd', all=True) }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# returns : [dict, ...]
- debug: msg="{{ lookup('ziouf.tpm.password', 'username:admin tag:nexus,prd', all=True, field='password') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# returns : [str, ...]
- debug: msg="{{ query('ziouf.tpm.password', 'username:admin tag:nexus,prd', all=True, field='password') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# returns : [str, ...]

# Get matching password id
- debug: msg="{{ lookup('ziouf.tpm.password', id=1234) }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# returns : dict
- debug: msg="{{ lookup('ziouf.tpm.password', id=1234, field='password') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# returns : str

# Generate a new password
- debug: msg="{{ lookup('ziouf.tpm.password', generate=True) }}"

Inputs

    
id:
    description: Id of wanted secret
    required: false

field:
    default: password
    description: Field to be return
    required: false

_terms:
    description: List of TPM queries to find desired password informations
    required: true

generate:
    default: false
    description: generate a new password from Team Password Manager API
    type: bool

hostname:
    description: 'TeamPasswordManager api hostname

      Fallback to TPM_HOST environment variable if not defined

      Expected format : hostname.domain:port/app-path-if-needed

      Examples: teampasswordmanager.com:443 or my-corporate-domainname.com/tpm-path

      '
    required: false

password:
    description: Team Password Manager api password for Basic authentication
    required: false

username:
    description: Team Password Manager api login for Basic authentication
    required: false

wantlist:
    default: false
    description: Return all results
    required: false
    type: bool

public_key:
    description: Team Password Manager api public key for HMAC authentication
    required: false

private_key:
    description: Team Password Manager api private key for HMAC authentication
    required: false

Outputs

_list:
  description:
  - TeamPasswordManager data matching spcified query
  elements: json
  type: list