esp.terraform.tfe_user_info (0.1.0) — module

List user accounts

| "added in version" 0.1.0 of esp.terraform"

Authors: Krzysztof Lewandowski (@klewan)

Install collection

Install with ansible-galaxy collection install esp.terraform:==0.1.0


Add to requirements.yml

  collections:
    - name: esp.terraform
      version: 0.1.0

Description

Lists user accounts in the Terraform Enterprise installation.

Details on a given user can be retrieved either by its id, email or by its name.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve details on all users
  esp.terraform.tfe_user_info:
    url: 'https://terraform.example.com'
    token: '{{ token }}'
    user:
      - '*'
    validate_certs: no
  register: _result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve details on given users (supplied by names, emails or IDs)
  esp.terraform.tfe_user_info:
    url: 'https://terraform.example.com'
    token: '{{ token }}'
    user:
      - jsmith@example.com
      - ann_doe
      - user-ctVahEhZNb22D5Se
    validate_certs: no
  register: _result

Inputs

    
url:
    description:
    - Terraform Enterprise URL.
    required: false
    type: str

user:
    default:
    - '*'
    description:
    - List of users to retrieve details for.
    - This can be '*' which means all users.
    - One may refer to a user either by its id, email or its name.
    required: true
    type: list

sleep:
    default: 5
    description:
    - Number of seconds to sleep between API retries.
    type: int

token:
    description:
    - All requests to Terraform Enterprise must be authenticated with a bearer token.
    - There are three kinds of token available, i.e. user tokens, team tokens and organization
      tokens.
    - See L(Authentication,https://www.terraform.io/docs/cloud/api/index.html#authentication).
    required: true
    type: str

retries:
    default: 3
    description:
    - Number of retries to call Terraform API URL before failure.
    type: int

use_proxy:
    default: true
    description:
    - If C(no), it will not use a proxy, even if one is defined in an environment variable
      on the target hosts.
    type: bool

validate_certs:
    default: true
    description:
    - If C(no), SSL certificates will not be validated.
    - This should only set to C(no) used on personally controlled sites using self-signed
      certificates.
    type: bool

Outputs

json:
  contains:
    data:
      description: Details on users.
      elements: dict
      returned: success
      sample:
      - attributes:
          avatar-url: https://www.gravatar.com/avatar/73e8b34b8de0f050f5fdd7960ef0c756?s=100&d=mm
          email: jsmith@example.com
          is-admin: true
          is-service-account: false
          is-suspended: false
          two-factor:
            enabled: false
            verified: false
          username: john_smith
        id: user-K1LWGyjmnDL59y4H
        links:
          self: /api/v2/users/user-K1LWGyjmnDL59y4H
        relationships:
          authentication-tokens:
            links:
              related: /api/v2/users/user-K1LWGyjmnDL59y4H/authentication-tokens
          organizations:
            data:
            - id: foo
              type: organizations
        type: users
      type: list
  description: Details on users.
  returned: success
  type: dict