esp.terraform.tfe_team_membership (0.1.0) — module

Manage team membership

| "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

Adds or removes users from teams.

Both users and the team must already exist.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add users to a team
  esp.terraform.tfe_team_membership:
    url: 'https://terraform.example.com'
    token: '{{ token }}'
    organization: foo
    team: owners
    user:
      - john_smith  
    state: present 
    validate_certs: no
  register: _result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove users from a team
  esp.terraform.tfe_team_membership:
    url: 'https://terraform.example.com'
    token: '{{ token }}'
    organization: foo
    team: owners
    user:
      - john_smith
      - user-ctVahEhZNb22D5Se   
    state: absent 
    validate_certs: no
  register: _result

Inputs

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

team:
    description:
    - Terraform team to add users to or remove users from.
    - The team may be referred either by its id or its name.
    required: true
    type: str

user:
    description:
    - List of users to add or remove from the team.
    - You must refer to a user by its name when C(state=present).
    - You may refer to a user either by its id or its user name when C(state=absent).
    required: true
    type: list

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

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Whether the users should be members of the team or not.
    required: true
    type: str

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

organization:
    description:
    - Organization name.
    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

organization:
  description: Organization name or external-id.
  returned: always
  sample: foo
  type: str
state:
  description: Membership state
  returned: always
  sample: present
  type: str
team:
  description: Team name or ID
  returned: always
  sample: owners
  type: str
users:
  description: List of users added or removed.
  elements: str
  returned: success
  sample:
  - user-K1LWGyjmnDL59y4H
  - john_smith
  type: list