diff --git a/lib/bolt/inventory/inventory.rb b/lib/bolt/inventory/inventory.rb index 82a688bc7b..54d67b387c 100644 --- a/lib/bolt/inventory/inventory.rb +++ b/lib/bolt/inventory/inventory.rb @@ -119,8 +119,7 @@ def match_wildcard?(wildcard, target_name, ext_glob: false) if ext_glob File.fnmatch(wildcard, target_name, File::FNM_CASEFOLD | File::FNM_EXTGLOB) else - regexp = Regexp.new("^#{Regexp.escape(wildcard).gsub('\*', '.*?')}$", Regexp::IGNORECASE) - target_name =~ regexp + File.fnmatch(wildcard, target_name, File::FNM_CASEFOLD) end end