diff --git a/lib/ansible/inventory/__init__.py b/lib/ansible/inventory/__init__.py index 830d74c01e..64bae5d815 100644 --- a/lib/ansible/inventory/__init__.py +++ b/lib/ansible/inventory/__init__.py @@ -235,6 +235,10 @@ class Inventory(object): a tuple of (start, stop) or None """ + # Do not parse regexes for enumeration info + if pattern.startswith('~'): + return (pattern, None) + # The regex used to match on the range, which can be [x] or [x-y]. pattern_re = re.compile("^(.*)\[([-]?[0-9]+)(?:(?:-)([0-9]+))?\](.*)$") m = pattern_re.match(pattern)