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

Unable to use 'nil' in backend to force default

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Do
    • Affects Version/s: HI 3.2.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Template:
    • QA Risk Assessment:
      Needs Assessment

      Description

      In older versions of Hiera you could use a nil in the backend to force the Hiera default to be selected.

      For example, given the simple Hierarchy:

      ---
      :hierarchy:
        - 'data/host'
        - 'data/common'
      

      And data/common with:
      my_var: 'global val'

      You could use in data/host:
      my_var: ~

      And Hiera would return the specified default value back to Puppet. This would allow the intentional "unsetting" of a particular key in Hiera for a small set of hosts that otherwise received more global Hiera-based settings.

      This used to work in Hiera and was usable from Puppet with hiera('my_key', 'a default')

      Now, Hiera (arguably more correctly) returns the found value nil, but Puppet doesn't fall back to the default, it instead raises an error and aborts the catalog compilation.

      This breaks a small but important bit of flexibility in Hiera.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            seanmil Sean Millichamp
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support