lib/bolt/outputter/human.rb
# Print target names and where they came from.
#
# @param adhoc [Hash] Adhoc targets provided on the command line.
# @param inventory [Hash] Targets provided from the inventory.
# @param flag [Boolean] Whether a targeting command-line option was used.
#
Print target names and where they came from.
Print target names and where they came from .
def print_targets(adhoc:, inventory:, flag:, **_kwargs)
        adhoc_text = colorize(:yellow, "(Not found in inventory file)")
        targets  = []
        targets += inventory[:targets].map { |target| [target['name'], nil] }
        targets += adhoc[:targets].map { |target| [target['name'], adhoc_text] }
        info = +''
        info << colorize(:cyan, "Targets\n")
        info << if targets.any?
                  format_table(targets, 2, 2).to_s
                else
                  indent(2, 'No targets')
                end
        info << "\n\n"
        info << format_inventory_source(inventory[:file], inventory[:default])
        info << format_target_summary(inventory[:count], adhoc[:count], flag, false)
        @stream.puts info
      end
def print_targets ( adhoc : , inventory : , flag : , ** _kwargs ) adhoc_text = colorize ( :yellow , "(Not found in inventory file)" ) targets = [ ] targets += inventory [ :targets ] . map { | target | [ target [ 'name' ] , nil ] } targets += adhoc [ :targets ] . map { | target | [ target [ 'name' ] , adhoc_text ] } info = + '' info << colorize ( :cyan , "Targets\n" ) info << if targets . any? format_table ( targets , 2 , 2 ) . to_s else indent ( 2 , 'No targets' ) end info << "\n\n" info << format_inventory_source ( inventory [ :file ] , inventory [ :default ] ) info << format_target_summary ( inventory [ :count ] , adhoc [ :count ] , flag , false ) @stream . puts info end
Print target names and where they came from.
Print target names and where they came from .
# Add target list
adhoc
Adhoc targets provided on the command line.
Adhoc targets provided on the command line .
inventory
Targets provided from the inventory.
Targets provided from the inventory .
flag
Whether a targeting command-line option was used.
Whether a targeting command - line option was used .
_kwargs
<not_specific>