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

[constructed-inventory] Constructed inventory as alternative to smart inventory #13303

Merged

Conversation

AlanCoding
Copy link
Member

@AlanCoding AlanCoding commented Dec 7, 2022

SUMMARY

Connect #13447

Replaces first draft of #13214

ISSUE TYPE
  • New or Enhanced Feature

Second Draft

This was a full Proof-of-Concept that can replicate the steps outlined in the CLI-based demo here:

https://github.com/AlanCoding/Ansible-inventory-file-examples/tree/master/issues/AWX371

It has been edited since then, and that is no longer entirely the functionality.

Key changes with this version:

  • Introduced a new kind of inventory, "multiple" which linked to multiple source inventories
  • Introduced "constructed" inventory source which adds (at runtime in this version) constructed vars / groups

Third Draft

This will be continually edited as the shape of the feature changes.

Key changes with this version:

  • Instead of a "multiple" kind of inventory, this changes to a "constructed" kind of inventory
  • The inventory kind corresponds to a 1-to-1 mandatory "constructed" inventory source
  • The inventory/source updates independently

key TODOs:

  • Add --limit to inventory sources
ISSUE TYPE
  • New or Enhanced Feature
COMPONENT NAME
  • API

@AlanCoding AlanCoding changed the title [PoC] Multi-inventories + constructed as alternative to smart inventories [PoC] Constructed inventory as alternative to smart inventory Jan 11, 2023
@AlanCoding AlanCoding changed the base branch from devel to feature_constructed-inventory January 18, 2023 13:55
@AlanCoding AlanCoding changed the title [PoC] Constructed inventory as alternative to smart inventory [constructed-inventory] Constructed inventory as alternative to smart inventory Jan 18, 2023
@AlanCoding AlanCoding marked this pull request as ready for review January 18, 2023 14:19
Add in required setting about empty groups
awx/main/tasks/jobs.py Outdated Show resolved Hide resolved
@AlanCoding AlanCoding merged commit d7f87ed into ansible:feature_constructed-inventory Jan 19, 2023
@@ -1709,8 +1704,17 @@ def get_related(self, obj):
labels=self.reverse('api:inventory_label_list', kwargs={'pk': obj.pk}),
)
)
if obj.kind in ('', 'constructed'):
Copy link
Member

Choose a reason for hiding this comment

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

if these are ones that shouldn't show for "smart" inventory should we make this if statement reflect the condition?

Copy link
Member Author

Choose a reason for hiding this comment

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

you mean change this to obj.kind != 'smart'?

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

Successfully merging this pull request may close these issues.

4 participants