esp.terraform.tfe_team_access_info (0.1.0) — module

List team's permissions on a workspace

| "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 team's permissions on a workspace.

A team-workspace resource represents a team's local permissions on a specific workspace.

A single team-workspace resource contains the relationship between the Team and Workspace, including the privileges the team has on the workspace.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: List team access to the supplied workspaces
  esp.terraform.tfe_team_access_info:
    url: 'https://terraform.example.com'
    token: '{{ token }}'
    organization: foo
    workspace:
      - my-workspace
      - ws-XGA52YVykdTgryTN
      #- '*'
    validate_certs: no
  register: _result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Show team access for the supplied teams
  esp.terraform.tfe_team_access_info:
    url: 'https://terraform.example.com'
    token: '{{ token }}'
    organization: foo
    team:
      - developers
      - team-EhuyjdMvkUaLLMEd
      #- '*'
    validate_certs: no
  register: _result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Show a team access relationship
  esp.terraform.tfe_team_access_info:
    url: 'https://terraform.example.com'
    token: '{{ token }}'
    organization: foo
    relationship:
      - tws-19iugLwoNgtWZbKP
      #- '*'
    validate_certs: no
  register: _result

Inputs

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

team:
    description:
    - List of teams to retrieve permissions for.
    - This can be '*' which means all teams.
    - One may refer to a team either by its ID or its name.
    - One of C(team), C(workspace) or C(relationship) is required.
    required: false
    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

workspace:
    description:
    - List of workspace to retrieve relationships with teams for.
    - This can be '*' which means all workspaces.
    - One may refer to a workspace either by its ID or its name.
    - One of C(team), C(workspace) or C(relationship) is required.
    required: false
    type: list

organization:
    description:
    - Organization name.
    required: true
    type: str

relationship:
    description:
    - List of team-workspace resources to retrieve details for.
    - This can be '*' which means all relationships.
    - Refer to a relationship by its ID, i.e. tws-*.
    - One of C(team), C(workspace) or C(relationship) is required.
    required: false
    type: list

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 team access.
      elements: dict
      returned: success
      sample:
      - attributes:
          access: plan
          runs: plan
          sentinel-mocks: none
          state-versions: read
          variables: read
          workspace-locking: false
        id: tws-P6ehPeR96ngzRtep
        links:
          self: /api/v2/team-workspaces/tws-P6ehPeR96ngzRtep
        relationships:
          team:
            data:
              id: team-EhuyjdMvkUaLLMEd
              type: teams
            links:
              related: /api/v2/teams/team-EhuyjdMvkUaLLMEd
          workspace:
            data:
              id: ws-upBS5wz93fDhtwpn
              type: workspaces
            links:
              related: /api/v2/organizations/esp-api-test/workspaces/my-workspace
        type: team-workspaces
      type: list
  description: Details on teams access.
  returned: success
  type: dict