def print_answers_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 config answers"
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 "# You can use these answers to quickly configure subsequent
# simp installations by running the command:
#
# simp config -A /PATH/TO/THIS/FILE
#
# simp config will prompt for any missing items.
#
# NOTE: All YAML keys that begin with 'cli::' are used
# by simp config, internally, and are not Puppet hieradata.
".gsub(/^\s+/, '').strip
iostream.puts "#" + '='*72
iostream.puts "---"
if @sort_output
answers = answers.sort.to_h
end
answers.each do |k,v|
if v.data_type and v.data_type != :internal
if yaml = v.to_yaml_s
yaml.split("\n").each { |line| iostream.puts line.rstrip }
iostream.puts
end
end
end
end