Why are Ansible Jobs Matching Non Qualifying Hostnames when Limiting Hosts with Regex?

Solution Verified - Updated -

Issue

When limiting an Ansible job with regex, some hosts included in the job run may not match the qualifying regex.

Example of limiting hosts with regex:

#ansible-playbook -i hosts hello-world.yml -l '~^[^\s]{5}[dqt][^\s].*[d4]$'

Environment

All Ansible versions when limit option is being used

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content