<commit_before>module Beaker
  module DSL
    module Helpers
      # Methods that help you interact with your hiera installation, hiera must be installed
      # for these methods to execute correctly
      module Hiera

        # Write hiera config file on one or more provided hosts
        #
        # @param[Host, Array<Host>, String, Symbol] host    One or more hosts to act upon,
        #                           or a role (String or Symbol) that identifies one or more hosts.
        # @param[Array] One or more hierarchy paths
        def write_hiera_config_on(host, hierarchy)

          block_on host do |host|
            hiera_config = {
              backends: 'yaml',
              yaml: {
                datadir: hiera_datadir(host)
              },
              hierarchy: hierarchy,
              logger: 'console'
            }
            create_remote_file host, host.puppet['hiera_config'], hiera_config.to_yaml
          end
        end

        # Write hiera config file for the default host<commit_msg>Do not shadow a variable<commit_after>module Beaker
  module DSL
    module Helpers
      # Methods that help you interact with your hiera installation, hiera must be installed
      # for these methods to execute correctly
      module Hiera

        # Write hiera config file on one or more provided hosts
        #
        # @param[Host, Array<Host>, String, Symbol] host    One or more hosts to act upon,
        #                           or a role (String or Symbol) that identifies one or more hosts.
        # @param[Array] One or more hierarchy paths
        def write_hiera_config_on(host, hierarchy)

          block_on host do |hst|
            hiera_config = {
              backends: 'yaml',
              yaml: {
                datadir: hiera_datadir(hst)
              },
              hierarchy: hierarchy,
              logger: 'console'
            }
            create_remote_file hst, hst.puppet['hiera_config'], hiera_config.to_yaml
          end
        end

        # Write hiera config file for the default host
{'fraction_non_alphanumeric': 0.05703238279362011, 'fraction_numerical': 0.0, 'mean_word_length': 1.7417218543046358, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2855621', 'n_tokens_mistral': 537, 'n_tokens_neox': 524, 'n_words': 199}