Giter Club home page Giter Club logo

Comments (4)

jnahelou avatar jnahelou commented on August 11, 2024 1

This issue was fixed by version 0.24.3.
It works using type scm:

 # awx_inventory_source.vault_sources will be created                                                                                                                                                                                      
  + resource "awx_inventory_source" "vault_sources" {
      + description          = "demo"
      + id                   = (known after apply)
      + inventory_id         = 106
      + name                 = "demo"
      + overwrite            = true
      + overwrite_vars       = true
      + source               = "scm"
      + source_project_id    = 95
      + update_cache_timeout = 30
      + update_on_launch     = true
      + verbosity            = 1
    }
awx_inventory_source.vault_sources: Creating...
awx_inventory_source.vault_sources: Creation complete after 1s [id=810]

Or using EC2

 # awx_inventory_source.vault_sources will be created
  + resource "awx_inventory_source" "vault_sources" {
      + description          = "demo"
      + id                   = (known after apply)
      + inventory_id         = 106
      + name                 = "demo"
      + overwrite            = true
      + overwrite_vars       = true
      + source               = "ec2"
      + update_cache_timeout = 30
      + update_on_launch     = true
      + verbosity            = 1
    }

awx_inventory_source.vault_sources: Creating...
awx_inventory_source.vault_sources: Creation complete after 0s [id=812]

from terraform-provider-awx.

nickscott77 avatar nickscott77 commented on August 11, 2024

Hi,

same issue here. Pls fix it.
AWX Version: 21.12.0

from terraform-provider-awx.

fernando-eickhoff avatar fernando-eickhoff commented on August 11, 2024

Still having this issue after such a long time without any kind of answer.

Figured out by myself the issue probably is related to this fix here: #20

Basically it seems that now it is mandatory to set the source_project_id in the awx_inventory_source even if the inventory kind is not a scm inventory. The source_project_id should only be mandatory for scm inventories.

Well, my inventory is not of scm kind, it is a regular one, empty string.

for_each = local.awx_inventories.vault

resource "awx_inventory" "awx_inventory_vault" {
name            = each.value.name
description     = each.value.description
kind            = ""

If I set an aleatory but valid project ID in the inventory_source it does not work:

resource "awx_inventory_source" "vault_sources" {
  for_each = local.inventory_sources

  inventory_id = awx_inventory.awx_inventory_vault[each.key].id
  name = each.value.source_name
  credential_id = data.awx_credential.aws.id
  description = each.value.source_description
  overwrite = true
  update_on_launch = true
  overwrite_vars = true
  source = "ec2"
  source_project_id = awx_project.awx_projects["master"].id
│ 
│ Unable to create Inventory Source got Errors:
│ - detail: [Cannot set source_project if not SCM type.]
╵

And if I don't set a project id it does not allow too:

# source_project_id = awx_project.awx_projects["master"].id

╷
│ Error: Unable to create Inventory Source
│ 
│   with awx_inventory_source.vault_sources["qa"],
│   on main.tf line 474, in resource "awx_inventory_source" "vault_sources":
│  474: resource "awx_inventory_source" "vault_sources" {
│ 
│ Unable to create Inventory Source got Errors:
│ - detail: []
╵
╷
│ Error: Unable to update Inventory Source
│ 
│   with awx_inventory_source.vault_sources["staging"],
│   on main.tf line 474, in resource "awx_inventory_source" "vault_sources":
│  474: resource "awx_inventory_source" "vault_sources" {
│ 
│ Unable to update Inventory Source with id 77: got Errors:
│ - source_project: [Invalid pk "0" - object does not exist.]

from terraform-provider-awx.

fernando-eickhoff avatar fernando-eickhoff commented on August 11, 2024

Looks like this PR #29 mentioned in this issue #19 will solve this error but for some reason the PR was not merged yet

from terraform-provider-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.