lib/bolt/inventory/inventory.rb
# If target is a group name, expand it to the members of that group.
# Else match against targets in inventory by name or alias.
# If a wildcard string, error if no matches are found.
# Else fall back to [target] if no matches are found.
If target is a group name, expand it to the members of that group.
Else match against targets in inventory by name or alias.
If a wildcard string, error if no matches are found.
Else fall back to [target] if no matches are found.
If target is a group name expand it to the members of that group . Else match against targets in inventory by name or alias . If a wildcard string error if no matches are found . Else fall back to [ target ] if no matches are found .
def resolve_name(target)
        if (group = group_lookup[target])
          group.all_targets
        else
          regexp = Regexp.new("^#{Regexp.escape(target).gsub('\*', '.*?')}$", Regexp::IGNORECASE)
          targets = groups.all_targets.select { |targ| targ =~ regexp }
          targets += groups.target_aliases.select { |target_alias, _target| target_alias =~ regexp }.values
          if targets.empty?
            raise(WildcardError, target) if target.include?('*')
            [target]
          else
            targets
          end
        end
      end
def resolve_name ( target ) if ( group = group_lookup [ target ] ) group . all_targets else regexp = Regexp . new ( "^#{Regexp.escape(target).gsub('\*', '.*?')}$" , Regexp :: IGNORECASE ) targets = groups . all_targets . select { | targ | targ =~ regexp } targets += groups . target_aliases . select { | target_alias , _target | target_alias =~ regexp } . values if targets . empty? raise ( WildcardError , target ) if target . include? ( '*' ) [ target ] else targets end end end
If target is a group name, expand it to the members of that group.
If target is a group name expand it to the members of that group .
# Try to wildcard match targets in inventory # Ignore case because hostnames are generally case-insensitive
target
<not_specific>