Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-5983

Environment Data Provider has different interpolation behavior than Hiera

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.3.2
    • Fix Version/s: PUP 4.4.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Epic Link:
    • Story Points:
      1
    • Sprint:
      Language 2016-03-09, Language 2016-03-23
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Lookup of hiera defined data in environments and modules did not to perform interpolation in nested arrays and hashes, instead the strings containing the interpolation instructions were returned as is. This has now been corrected.

      Description

      I haven't found duplicate reports of this.

      YAML Sample:

      ---
      somevar:
          - 1
          - 2
          - 3
          
      foobar: "%{alias('somevar')}"
       
      foobar_array:
          - "%{alias('somevar')}"
       
      foobar_hash:
          subkey: "%{alias('somevar')}"
          
      foobar_hash_hash:
          subkey:
              subkey: "%{alias('somevar')}"
      

      Result of the sample put into Global Hiera

      for f in somevar foobar foobar_array foobar_hash foobar_hash_hash; do echo $f; puppet lookup $f --node puppet.example.com; done
      somevar
      ---
      - 1
      - 2
      - 3
      foobar
      ---
      - 1
      - 2
      - 3
      foobar_array
      ---
      - - 1
        - 2
        - 3
      foobar_hash
      ---
      subkey:
      - 1
      - 2
      - 3
      foobar_hash_hash
      ---
      subkey:
        subkey:
        - 1
        - 2
        - 3
      

      Result put into Environment Hiera

      for f in somevar foobar foobar_array foobar_hash foobar_hash_hash; do echo $f; puppet lookup $f --node puppet.example.com; done
      somevar
      ---
      - 1
      - 2
      - 3
      foobar
      ---
      - 1
      - 2
      - 3
      foobar_array
      ---
      - "%{alias('somevar')}"
      foobar_hash
      ---
      subkey: "%{alias('somevar')}"
      foobar_hash_hash
      ---
      subkey:
        subkey: "%{alias('somevar')}"
      

      Obviously, the behavior should be maintained.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              andvgal Andrey Galkin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support