Git Product home page Git Product logo

Comments (4)

thedoubl3j avatar thedoubl3j commented on June 25, 2024 1

Reasonable request, my guess is it would take some work in https://github.com/ansible/awx/blob/devel/awx_collection/plugins/modules/inventory_source.py. If someone has time, feel free to take a crack, might be a bit before we can get to it though @vvarga007 but very doable/in scope I think.

from awx.

vvarga007 avatar vvarga007 commented on June 25, 2024

@thedoubl3j I took a quick look at this. To create a terraform state inventory source, the only thing that we have to do is to add 'terraform' as a valid choice.( https://github.com/ansible/awx/blob/devel/awx_collection/plugins/modules/inventory_source.py)
I changed it to this:

source=dict(choices=["scm", "ec2", "gce", "azure_rm", "vmware", "satellite6", "openstack", "rhv", "controller", "insights", "terraform"]),

After this change, I was able to create an inventory source with the following task:

- name: Add an inventory source 'TF_source'
  awx.awx.inventory_source:
    inventory: Inventory_TEST_TF_SOURCE
    name: TF_source
    source: terraform
    source_vars:
      backend_type: s3
    credential: TF_TEST
    organization: Default
    state: present

from awx.

vvarga007 avatar vvarga007 commented on June 25, 2024

I checked the TF backend credential, too. It seems that works out of the box.
This combo works like a charm after that minor change in my previous comment.

- 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

from awx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.