Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inventoryID issue with Job resource #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abikouo
Copy link
Contributor

@abikouo abikouo commented Jun 25, 2024

Closes #31

  • Fix issue when create Job resource using Job template ID which does not allow running with a different inventory ID (Template does not prompt for inventory Id at launch)
  • Update acceptance tests to validate inventory Id

@abikouo abikouo force-pushed the job_resource_issue_31 branch from 6c9affc to 6d8e536 Compare July 2, 2024 14:25
Comment on lines +270 to +272
if r.InventoryID.ValueInt64() == 0 {
r.InventoryID = types.Int64Value(resultApiJob.Inventory)
}
Copy link
Member

@gravesm gravesm Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like the bug this is trying to fix was introduced by https://github.com/ansible/terraform-provider-aap/pull/10/files#diff-afd9b829236927b85ef1814941bb6f012eed9cca71547f9f9ce15dcceb29a6f4R216-R219. I don't know why that change was made, but, among other things, it makes it impossible to use a job template that has a default inventory and is configured to prompt on launch. I think fixing that bug makes this bug go away, because it shouldn't be possible to launch a job with prompt on launch and no default inventory set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to update job resource with inventory Id
2 participants