pytoccaz.utils.env_info (1.4.0) — module

Queries environment variables on the target host

| "added in version" 1.4.0 of pytoccaz.utils"

Authors: Olivier Bernard (@pytoccaz)

Install collection

Install with ansible-galaxy collection install pytoccaz.utils:==1.4.0


Add to requirements.yml

  collections:
    - name: pytoccaz.utils
      version: 1.4.0

Description

Queries environment variables on the target host (python os.getenv wrapper)

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Query for some envs
  pytoccaz.utils.env_info:
    envs:
      - HOME
      - LANG
  register: get_envs

Inputs

    
envs:
    aliases:
    - get
    - get_envs
    - env_list
    description: 'A list of system environment variables to retrieve

      '
    elements: str
    required: true
    type: list

Outputs

result:
  description: A key-value dictionary with keys as variable names and their corresponding
    values as values
  returned: success
  sample:
    PATH: /usr/bin:/etc/local/bin
    USERNAME: olivier
  type: dict