Has anyone figured out how to exclude a pattern match in AWX smart inventory search? The documentation and other blogs seem to be a bit vauge about it.
I am aware AWX UI has some limitations hence the devs suggest using tower-cli for this purpose which we have been.
If I have following servers:
loc1vm10a01
loc2vm20a01
loc1vm10b02
loc3vm40c09
loc1vm20a05
I can use tower-cli smart inventory search filter like --host-filter "search=loc1 and search=a0"
which will return loc1vm10a01 and loc1vm20a05
However, what we'd ideally want is something like, include all the 'loc1' VMs but ignore VMs with 'b0' in its name.
I have tried all combinations of using not
, is.not
, !
, etc. but nothing seems to work.
E.g. --host-filter "search=loc1 and not search=a0"
Or --host-filter "search=loc1 and search=!a0"
Any suggestions on how to achieve this?
Thanks!