Skip to content

API & Form-integration for inventory-list (limit-field suggestions)#78

Merged
superstes merged 8 commits into
latestfrom
inventory-list
Oct 27, 2025
Merged

API & Form-integration for inventory-list (limit-field suggestions)#78
superstes merged 8 commits into
latestfrom
inventory-list

Conversation

@superstes

@superstes superstes commented Oct 26, 2025

Copy link
Copy Markdown
Member

As described in #29

  • API
  • Frontend
    • Job-Edit view
    • Follow-up ticket => Dedicated view
  • Changelog
image image image

Example API output:

api/inventory/list?inventory=inv%2Fhosts.yml&limit=all

Details ``` { "hosts": [ "fw01", "fw02", "gcp01", "gcp02", "gcp03", "gcp04", "hetzner01", "hetzner02", "hetzner03", "srv01", "srv02", "srv03", "sw01", "sw02" ], "groups": [ "all", "cloud", "firewalls", "gcp", "gcp_eu_cent", "gcp_eu_west", "hetzner", "hetzner_de_fk", "hetzner_fi_he", "network", "onsite", "switches" ], "members": { "all": [ "fw01", "fw02", "gcp01", "gcp02", "gcp03", "gcp04", "hetzner01", "hetzner02", "hetzner03", "srv01", "srv02", "srv03", "sw01", "sw02" ], "cloud": [ "gcp01", "gcp02", "gcp03", "gcp04", "hetzner01", "hetzner02", "hetzner03" ], "firewalls": [ "fw01", "fw02" ], "gcp": [ "gcp01", "gcp02", "gcp03", "gcp04" ], "gcp_eu_cent": [ "gcp03", "gcp04" ], "gcp_eu_west": [ "gcp01", "gcp02" ], "hetzner": [ "hetzner01", "hetzner02", "hetzner03" ], "hetzner_de_fk": [ "hetzner01", "hetzner02" ], "hetzner_fi_he": [ "hetzner03" ], "network": [ "fw01", "fw02", "sw01", "sw02" ], "onsite": [ "fw01", "fw02", "srv01", "srv02", "srv03", "sw01", "sw02" ], "switches": [ "sw01", "sw02" ] } } ```

api/inventory/list?inventory=inv%2Fhosts.yml&limit=cloud

Details ``` { "hosts": [ "gcp01", "gcp02", "gcp03", "gcp04", "hetzner01", "hetzner02", "hetzner03" ], "groups": [ "all", "cloud", "gcp", "gcp_eu_cent", "gcp_eu_west", "hetzner", "hetzner_de_fk", "hetzner_fi_he", "network", "onsite" ], "members": { "all": [ "gcp01", "gcp02", "gcp03", "gcp04", "hetzner01", "hetzner02", "hetzner03" ], "cloud": [ "gcp01", "gcp02", "gcp03", "gcp04", "hetzner01", "hetzner02", "hetzner03" ], "gcp": [ "gcp01", "gcp02", "gcp03", "gcp04" ], "gcp_eu_cent": [ "gcp03", "gcp04" ], "gcp_eu_west": [ "gcp01", "gcp02" ], "hetzner": [ "hetzner01", "hetzner02", "hetzner03" ], "hetzner_de_fk": [ "hetzner01", "hetzner02" ], "hetzner_fi_he": [ "hetzner03" ] } } ```

@superstes superstes merged commit d47c941 into latest Oct 27, 2025
4 of 5 checks passed
@superstes superstes deleted the inventory-list branch October 27, 2025 02:35
superstes added a commit that referenced this pull request Oct 27, 2025
@JohnSmall02

Copy link
Copy Markdown

Greetings,

finally had a look how this is working and is having issues on my side,
and thats probably because this feature is directly using the host-config file as input, what does not exist in my environment.
On my environment I only use the output of ansible-inventory, the input for that is coming from a python script what is configured like so:

[inventory]
enable_plugins=script
ignore_extensions={{ ('.txt', '.ini', '.cfg', '.j2', '.yml' ) }}

[defaults]
inventory=/etc/ansible/extras/hosts/

the mentioned python script is reading the host list from a separate postgres DB what gets processed by ansible-inventory.
I have chosen to do this back at the time when I started using ansible, cause there are also playbooks for adding/ removing hosts dynamically, and so no manual interaction in the container is necessary.

ansible-inventory --list creates a nice json output what e.g. I used as input for what I mentioned in #29

I would be a nicer way because then it does not matter where the host list comes from, ansible-inventory is always processing it.

kthx

@superstes

Copy link
Copy Markdown
Member Author

Thank you for the feedback 👍

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.

2 participants