Uploaded image for project: 'Hiera'
  1. Hiera
  2. HI-529

literal interpolation function can appear only once

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Duplicate
    • Affects Version/s: HI 3.2.0
    • Fix Version/s: None
    • Component/s: Community
    • Labels:
      None
    • Environment:
    • Template:

      Description

      Like described in HI-501 or HI-513, we just can't resolve hiera data that is using multiple literal('%').

      Exact same issue that in HI-513:

      /etc/hiera.yaml

      ---
      :backends:
        - yaml
       
      :hierarchy:
        - common
       
      :yaml:
        :datadir: /home/puppet
      

      /home/puppet/common.yaml

      ---
      content: "%{literal('%')}{secret} %{literal('%')}{secret2}"
      

      hiera_cli

      $ /opt/puppetlabs/bin/hiera --config /etc/hiera.yaml content
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/recursive_guard.rb:13:in `check': Lookup recursion detected in [literal('%')] (Hiera::InterpolationLoop)
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/interpolate.rb:68:in `do_interpolation'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/interpolate.rb:47:in `block in interpolate'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/interpolate.rb:46:in `gsub'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/interpolate.rb:46:in `interpolate'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend.rb:142:in `parse_string'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend.rb:153:in `parse_answer'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend/yaml_backend.rb:37:in `block in lookup'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend.rb:120:in `block in datasourcefiles'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend.rb:92:in `block in datasources'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend.rb:90:in `map'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend.rb:90:in `datasources'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend.rb:115:in `datasourcefiles'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend/yaml_backend.rb:17:in `lookup'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend.rb:270:in `block (2 levels) in lookup'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend.rb:268:in `catch'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend.rb:268:in `block in lookup'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend.rb:263:in `each'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend.rb:263:in `lookup'
              from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera.rb:116:in `lookup'
              from /opt/puppetlabs/bin/hiera:246:in `<main>'
      

      I obtain the exact same error as in the quoted ticket with the latest available version of hiera.

      I can see that HI-513 as been closed but can't figure out how to solve my problem.

      This is currently a problem for me as I'm curently retrieving something like

      %{REMOTE_USER}
      

      for my Apache configuration stored in Hiera.

      If there is a quick workaround, please let me know.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                remi.ferrand Remi Ferrand
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support