Uploaded image for project: 'Puppet Development Kit'
  1. Puppet Development Kit
  2. PDK-1609

The default order in hiera.yaml is incorrect

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDK 1.17.0
    • Component/s: None
    • Template:
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      The hiera.yml template has been updated for new modules so that data from files named after the operating system are higher in the hierarchy than files named after the operating system family.
    • QA Risk Assessment:
      Needs Assessment

      Description

      The default hiera.yaml that is laid down by PDK is as follows:

      ---
      version: 5defaults:  # Used for any hierarchy level that omits these keys.
        datadir: data         # This path is relative to hiera.yaml's directory.
        data_hash: yaml_data  # Use the built-in YAML backend.hierarchy:
        - name: "osfamily/major release"
          paths:
            - "os/%{facts.os.family}/%{facts.os.release.major}.yaml"
              # Used for Solaris
            - "os/%{facts.os.family}/%{facts.kernelrelease}.yaml"
              # Used to distinguish between Debian and Ubuntu
            - "os/%{facts.os.name}/%{facts.os.release.major}.yaml"
        - name: "osfamily"
          paths:
            - "os/%{facts.os.family}.yaml"
            - "os/%{facts.os.name}.yaml"
        - name: 'common'
          path: 'common.yaml'

      I believe that this is incorrect since facts.os.name is more specific than facts.os.family and therefore the two should be reversed as follows:

      ---
      version: 5defaults:  # Used for any hierarchy level that omits these keys.
        datadir: data         # This path is relative to hiera.yaml's directory.
        data_hash: yaml_data  # Use the built-in YAML backend.hierarchy:
        - name: "osfamily/major release"
          paths:
            - "os/%{facts.os.name}/%{facts.os.release.major}.yaml"
            - "os/%{facts.os.family}/%{facts.os.release.major}.yaml"
              # Used for Solaris
            - "os/%{facts.os.family}/%{facts.kernelrelease}.yaml"
              # Used to distinguish between Debian and Ubuntu
        - name: "osfamily"
          paths:
            - "os/%{facts.os.name}.yaml"
            - "os/%{facts.os.family}.yaml"
        - name: 'common'
          path: 'common.yaml' 

        Attachments

          Activity

            People

            Assignee:
            tim.sharpe Tim Sharpe
            Reporter:
            peiriannydd Trevor Vaughan
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support