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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.