ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
14.12k stars 3.44k forks source link

Add smart inventory host filter lookup text input #7850

Open marshmalien opened 4 years ago

marshmalien commented 4 years ago
ISSUE TYPE
SUMMARY

Expose a simple text input that a user could opt in to when creating a smart inventory host filter where a complete host_filter string could be supplied. This would serve 2 purposes:

  1. Users wanting to specify complex/non-ui supported host filter strings could do so in the UI and wouldn't have to go through the API browser
  2. If the UI detects a string that we can't parse into consumable search tags then we just show the string in the input.

Example of a host filter string that the user could type into the input:

(name=bengal and groups__name=Cat) or (name=vizsla and groups__name=Dog)

To retrieve the corresponding list of hosts and display them in the modal, the same filter string above must be url-encoded:

/hosts/?host_filter=(name%3Dbengal%20and%20groups__name%3D%22Cat%22)%20or%20(name%3Dvizsla%20and%20groups__name%3DDog)
ADDITIONAL INFO

Smart host filter docs: https://docs.ansible.com/ansible-tower/latest/html/userguide/inventories.html#smart-host-filter Initial host filter lookup PR: https://github.com/ansible/awx/pull/7644

Host filter lookup mockup: https://tower-mockups.testing.ansible.com/patternfly/inventories/inventories-smart-edit-filter/

Screen Shot 2020-08-06 at 12 37 42 PM

Image below is a mockup of what it could put in the host filter lookup or advanced search

Screen Shot 2020-08-06 at 12 31 09 PM
nixocio commented 2 years ago

See also: https://github.com/ansible/awx/issues/11985

cloneluke commented 4 months ago

I would love this feature, right now we can only filter on one ansible_fact at a time, but we brought in all of our aws tags as ansible facts and are limited here.