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

Hiera needs to validate the structure of its config file

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: HI 1.3.4, HI 2.0.0, HI 3.2.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Hiera does have a validate method in config.rb that is applied to the data structure loaded from `hiera.yaml`. Unfortunately, this validator currently only traps errors arising from missing the `deep_merge` gem.

      Hiera assumes that the config file will follow a certain structure and will crash or misbehave in strange ways if this structure is not present. For example, the :backends: and :hierarchy: keys can be set to arrays or single strings. However, the `:datadir` key will misbehave in weird ways if set to anything other than a string:

          # The documented structure for this setting is a single string
          :yaml:
            :datadir: "/path/to/some/dir/%{::environment}"
       
          # By coincidence, using an array will work
          :yaml:
            :datadir:
              - /path/to/some/dir
       
          # But... variable interpolation will mysteriously fail
          :yaml:
            :datadir:
              - "/path/to/some/dir/%{::environment}"
      

        Attachments

          Activity

            People

            • Assignee:
              chuck Charlie Sharpsteen
              Reporter:
              chuck Charlie Sharpsteen
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support

                  Time Tracking

                  Estimated:
                  Original Estimate - 2 days
                  2d
                  Remaining:
                  Remaining Estimate - 2 days
                  2d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified