Skip to content

collection: 'Terraform State' inventory source support (#15252)#15258

Merged
TheRealHaoLiu merged 1 commit into
ansible:develfrom
vvarga007:inv_src_tf
Jun 12, 2024
Merged

collection: 'Terraform State' inventory source support (#15252)#15258
TheRealHaoLiu merged 1 commit into
ansible:develfrom
vvarga007:inv_src_tf

Conversation

@vvarga007
Copy link
Copy Markdown
Contributor

SUMMARY

Fixes #15252

AWX 24.0.0 introduced a terraform state inventory source.
This change allows creating a terraform state inventory source with the 'awx.awx.inventory_source' module.

ISSUE TYPE
  • New or Enhanced Feature
COMPONENT NAME
  • Collection (awx.awx.inventory_source module)
AWX VERSION

ADDITIONAL INFORMATION

Example usage:

---
- name: Lookup plugin test
  hosts: localhost
  become: no
  gather_facts: no
  environment:
    CONTROLLER_HOST: https://yourawxurl.com/
    CONTROLLER_USERNAME: admin
    CONTROLLER_PASSWORD: foofoo

  tasks:
    - name: Add Inventory_TEST_TF_SOURCE
      awx.awx.inventory:
        name: Inventory_TEST_TF_SOURCE
        organization: Default
        state: present

    - name: Add TF backend configuration
      awx.awx.credential:
        name: TF_TEST
        credential_type: Terraform backend configuration
        organization: Default
        inputs:
          configuration: |
            bucket = "example-tfstates"
            key = "aws-test-instance/tf_state.tfstate"
            region = "us-east-1"
            access_key = "CHANGEME"
            secret_key = "CHANGEME"
    
    - name: Add an inventory source 'TF_source'
      awx.awx.inventory_source:
        inventory: Inventory_TEST_TF_SOURCE
        name: TF_soruce
        source: terraform
        source_vars:
          backend_type: s3
        credential: TF_TEST
        organization: Default
        overwrite: true
        overwrite_vars: true
        update_on_launch: true
        verbosity: 1
        state: present

@github-actions github-actions Bot added component:awx_collection issues related to the collection for controlling AWX community labels Jun 6, 2024
@TheRealHaoLiu TheRealHaoLiu enabled auto-merge (squash) June 12, 2024 19:10
@TheRealHaoLiu TheRealHaoLiu merged commit a711354 into ansible:devel Jun 12, 2024
@vvarga007 vvarga007 deleted the inv_src_tf branch June 12, 2024 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community component:awx_collection issues related to the collection for controlling AWX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

awx.awx collection: support for 'Terraform State' inventory source

3 participants