smart host filter regex

800 views
Skip to first unread message

Lorenzo Farinas

unread,
Jun 4, 2018, 3:36:14 PM6/4/18
to Ansible Development
I'm trying to filter our Tier 1 RHEL servers on Ansible Tower smart inventory that have ip's of 10.5.x.x, 10.50.x.x, and 10.51.x.x.  Red Hat provided this syntax for smart host filter, name.regex:"^10\.5[0-1]\..*$|^10\.5\..*$", but it did not work as I'm  getting 'No records matched your search’ .  I found out the variable for ip's when I looked at the Details for a host in Ansible Tower is ip, so i replaced name.regex with ip.regex:"^10\.5[0-1]\..*$|^10\.5\..*$", but I got error invalid quiery.  Please advise.

Adam Miller

unread,
Jun 19, 2018, 10:48:09 AM6/19/18
to farinas...@gmail.com, Ansible Development
On Mon, Jun 4, 2018 at 2:36 PM Lorenzo Farinas <farinas...@gmail.com> wrote:
>
> I'm trying to filter our Tier 1 RHEL servers on Ansible Tower smart inventory that have ip's of 10.5.x.x, 10.50.x.x, and 10.51.x.x. Red Hat provided this syntax for smart host filter, name.regex:"^10\.5[0-1]\..*$|^10\.5\..*$", but it did not work as I'm getting 'No records matched your search’ . I found out the variable for ip's when I looked at the Details for a host in Ansible Tower is ip, so i replaced name.regex with ip.regex:"^10\.5[0-1]\..*$|^10\.5\..*$", but I got error invalid quiery. Please advise.
>

I think this would be a better question for the Ansible Users mailing
list as this list is meant for development related discussion.

https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information

-AdamM

> --
> You received this message because you are subscribed to the Google Groups "Ansible Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-deve...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages