# File lib/simp/cli/config/items/action/hieradata_yaml_file_writer.rb, line 21
    def print_hieradata_yaml( iostream, answers )
      if @config_items['cli::simp::scenario']
         scenario_info = "for #{@config_items['cli::simp::scenario'].value} scenario "
      else
         scenario_info = ''
      end
      iostream.puts "#" + '='*72
      iostream.puts "# SIMP global configuration"
      iostream.puts "#"
      iostream.puts "# Generated #{scenario_info}on #{@start_time.strftime('%F %T')}"
      iostream.puts "# using simp-cli version #{Simp::Cli::VERSION}"
      iostream.puts "#" + '='*72
      iostream.puts "---"
      global_classes = []
      answers.sort.to_h.each do |k,v|
        if v.data_type
          if v.data_type == :global_hiera
            if yaml = v.to_yaml_s  # filter out nil results for items whose YAML is suppressed
              # get rid of trailing whitespace
              yaml.split("\n").each { |line| iostream.puts line.rstrip }
              iostream.puts
            end
          elsif v.data_type == :global_class
            # gather up the classes to be added to a  'classes' sequence at the end of the file
            global_classes << v.key
          end
        end
      end

      unless global_classes.empty?
        iostream.puts
        iostream.puts 'classes:'
        global_classes.each { |global_class| iostream.puts "  - #{global_class}" }
      end
    end