esp.terraform.tfe_vcs_connection_info (0.1.0) — module

List VCS connections in the organization

| "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 VCS connections between an organization and a VCS provider for use when creating or setting up workspaces.

Information is retrieved from OAuth Clients defined from the organization.

An OAuth Client represents the connection between an organization and a VCS provider.

Details on an OAuth Client can be retrieved either by its ID or by its name.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve details on all VCS connections in the organization
  esp.terraform.tfe_vcs_connection_info:
    url: 'https://terraform.example.com'
    token: '{{ token }}'
    organization: foo
    client:
      - '*'
    validate_certs: no
  register: _result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve details on the given VCS connections (supplied by names or IDs), in the organization
  esp.terraform.tfe_vcs_connection_info:
    url: 'https://terraform.example.com'
    token: '{{ token }}'
    organization: foo
    client:
      - My Bitbucket
      - oc-4BWCffCgwSGYCrkW
    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

client:
    default:
    - '*'
    description:
    - List of OAuth clients (VCS connections) to retrieve details for.
    - This can be '*' which means all OAuth clients (VCS connections).
    - One may refer to an OAuth client either by its ID or its name.
    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

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

json:
  contains:
    data:
      description: Details on OAuth Clients.
      elements: dict
      returned: success
      sample:
      - attributes:
          api-url: https://bitbucket.example.com
          callback-url: https://terraform.example.com/auth/2b81cf18-0e5a-48dc-95aa-cee4a15472b8/callback
          connect-path: /auth/2b81cf18-0e5a-48dc-95aa-cee4a15472b8?organization_id=1
          http-url: https://bitbucket.example.com
          key: 8eebbb1bf0a0f3a3e679fd0fb31b2647
          name: My New Bitbucket
          rsa-public-key: '-----BEGIN PUBLIC KEY- .... '
          service-provider: bitbucket_server
          service-provider-display-name: Bitbucket Server
          tfvcs: false
        id: oc-4BWCffCgwSGYCrkW
        relationships:
          oauth-tokens:
            data:
            - id: ot-o3MySY3Xo4nqbXBv
              type: oauth-tokens
            links:
              related: /api/v2/oauth-clients/oc-4BWCffCgwSGYCrkW/oauth-tokens
          organization:
            data:
              id: foo
              type: organizations
            links:
              related: /api/v2/organizations/foo
        type: oauth-clients
      type: list
  description: Details on OAuth Clients.
  returned: success
  type: dict
oauth_clients:
  description: List of OAuth Clients (VCS connections) to retrieve details for.
  elements: str
  returned: always
  sample:
  - My Bitbucket
  - oc-4BWCffCgwSGYCrkW
  type: list
organization:
  description: Organization name or external-id.
  returned: always
  sample: foo
  type: str