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

Add Instance Group functionality to Inventory Source Scripts #13995

Open
5 of 9 tasks
bar0n36 opened this issue May 12, 2023 · 6 comments
Open
5 of 9 tasks

Add Instance Group functionality to Inventory Source Scripts #13995

bar0n36 opened this issue May 12, 2023 · 6 comments

Comments

@bar0n36
Copy link

bar0n36 commented May 12, 2023

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX is open source software provided for free and that I might not receive a timely response.

Feature type

Enhancement to Existing Feature

Feature Summary

Under the current architecture of Inventory Source scripts, there is no way to assign an Instance Group to the inventory source script.

The scenario I have is that I have associated an inventory to a particular instance group, which is in a segregated network. This is because I want all template jobs associated with this Inventory to execute on that Instance Group by default (avoids having to train people to manually set the Instance Group on their templates).
When I try and sync the inventory sources, the sync job also attempts to execute on that Instance Group. This would be fine, except the Inventory Source web service is not available from the segregated network, so I would like to be able to tell it to execute on another instance group that does have access.

Is it possible to enhance the Inventory Sources to also allow associating of an Instance Group to them directly? That way for each Inventory Source I can define the correct Instance Group, which may, or may not (in this case not) be the same as that which I have set for the Inventory? I would propose this follows the same precedence rules governing Instance Groups as for Templates (1. Template, 2. Inventory, 3. Organisation), so it would end up as:

  1. Inventory Source job
  2. Inventory
  3. Organisation

I have searched as best I could through the open issues to see if this was already there, but couldn't see it.

My environment:
AWX 22.1.0 on K3s, deployed via Operator.

Select the relevant components

  • UI
  • API
  • Docs
  • Collection
  • CLI
  • Other

Steps to reproduce

To reproduce the issue, create a new instance group, with an Execution Instance that has no connectivity to the web service you wish to use as your inventory source

Create an inventory source script to pull data from a web service that is only accessible from the controller node (default instance)

Create the inventory and associate it to the new Instance Group, and assign the inventory source script etc.

Execute, and you should see the inventory script fail, as it cannot connect back to the Inventory Web Service.

Current results

Currently works as designed, executes on Inventory associated Execution Node

Sugested feature result

Allow users to set the Instance Group where the job will run.

Additional information

No response

@tanganellilore
Copy link
Contributor

Interested on it!

@ulysses-31
Copy link

ulysses-31 commented Dec 4, 2023

We have restricted networks with separate IGs defined and require the inventory source syncing to a web service to occur via the controller nodes IG. Very interested in the proposed functionality.

@MalfuncEddie
Copy link

just ran into this myself. work around would be to set every single job template.

@tanganellilore
Copy link
Contributor

tanganellilore commented Dec 4, 2023

just ran into this myself. work around would be to set every single job template.

This is not the use case for your post. In your case you can use IG on inventory or organization level.
We are asking to avoid run inventorys cripts (that can be intensive) on the controller node or dedicated node.

@MalfuncEddie
Copy link

I believe you misinterpreted my comment.

from the issue

The scenario I have is that I have associated an inventory to a particular instance group, which is in a segregated network. This is because I want all template jobs associated with this Inventory to execute on that Instance Group by default (avoids having to train people to manually set the Instance Group on their templates).

I also have to put a "wrong" instance group in the org/inventory so that the inventory sync can occur to "fix" the templates that need to execute on the "right" instance group I need to override the instance group to the right one in each job template.

This can be fixed if the inventory sync job could override the instance group of the org or inventory.

@tanganellilore
Copy link
Contributor

Hi @MalfuncEddie,
So if this is your use case, yes this issue can address this use case also.
Due to the fact that inventory script is already capable to run on IG, should be simply add this on UI and backend.

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

No branches or pull requests

5 participants