esp.terraform.tfe_organization_membership_info (0.1.0) — module

List organization memberships

| "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 organization memberships.

Organization memberships are searchable by user name, email or membership ID.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve details on all active organization memberships, include additional information about user and teams
  esp.terraform.tfe_organization_membership_info:
    url: 'https://terraform.example.com'
    token: '{{ token }}'
    organization: foo
    membership:
      - '*'
    status: active
    include:
      - user
      - teams
    validate_certs: no
  register: _result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve details on the supplied organization memberships, restricts results to active memberships
  esp.terraform.tfe_organization_membership_info:
    url: 'https://terraform.example.com'
    token: '{{ token }}'
    organization: foo
    membership:
      - jsmith@example.com
      - ou-SKVvnWhoTxWrofkE
      - user-K1LWGyjmnDL59y4H
      - john_doe
    status: active
    validate_certs: no
  register: _result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Display all invited memberships in the supplied organization
  esp.terraform.tfe_organization_membership_info:
    url: 'https://terraform.example.com'
    token: '{{ token }}'
    organization: foo
    membership:
      - '*'
    status: invited
    validate_certs: no
  register: _result  

Inputs

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

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

status:
    choices:
    - invited
    - active
    description:
    - If specified, restricts results to those with the matching status value. Valid values
      are C(invited) and C(active).
    required: false
    type: str

include:
    description:
    - Return additional information about nested resources.
    - This can be any of C(user) and C(teams).
    elements: str
    required: false
    type: list

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

membership:
    default:
    - '*'
    description:
    - List of organization memberships to retrieve details for.
    - Organization memberships are searchable by user name, email, user ID or membership
      ID.
    - The list can contain elements in any of these formats.
    - This can be '*' which means all memberships in the organization.
    required: false
    type: list

organization:
    description:
    - The name of the organization to list the memberships of.
    required: true
    type: str

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 memberships.
      elements: dict
      returned: success
      sample:
      - attributes:
          created-at: '2021-04-21T13:14:31.483000+00:00'
          email: jsmith@example.com
          status: active
        id: ou-SKVvnWhoTxWrofkE
        relationships:
          organization:
            data:
              id: foo
              type: organizations
          teams:
            data:
            - id: team-VQ1FncissQs9Bom8
              type: teams
          user:
            data:
              id: user-K1LWGyjmnDL59y4H
              type: users
        type: organization-memberships
      type: list
    included:
      description: Additional information about nested resources.
      elements: dict
      returned: success
      type: list
  description: Details on memberships.
  returned: success
  type: dict
organization:
  description: Organization name or external-id.
  returned: always
  sample: foo
  type: str