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

deep merge options in hiera v3 config not honored

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 4.9.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Team:
      Puppet Developer Experience
    • Story Points:
      1
    • Sprint:
      PDE 2017-01-25
    • Release Notes:
      Not Needed
    • Release Notes Summary:
      part of hiera 5 feature, problem this ticket solves was introduced in unreleased code.
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      covered by unit tests; deprecated behavior; low risk

      Description

      it appears deep_merge_options are being picked up in the config file, but somehow not understood or honored:

      [root@tcqscrr9nhig5nu v3_config_and_data_jmfzk9h3]# pwd
      /etc/puppetlabs/code/environments/v3_config_and_data_jmfzk9h3
      [root@tcqscrr9nhig5nu v3_config_and_data_jmfzk9h3]# cat hieradata/somesuch.*
      {
        "environment_key4" : ["jsonval", "4"]
      }
      ---
      environment_key4:
        - val
        - 4
      [root@tcqscrr9nhig5nu v3_config_and_data_jmfzk9h3]# cat /etc/puppetlabs/puppet/hiera.yaml
      ---
      :backends:
        - "yaml"
        - "json"
      :hierarchy:
        - "somesuch"
        - "common"
      :merge_behavior: deeper
      :deep_merge_options:
        :overwrite_arrays: true
      [root@tcqscrr9nhig5nu v3_config_and_data_jmfzk9h3]# puppet lookup --environment v3_config_and_data_jmfzk9h3 environment_key4 --explain
      Warning: /etc/puppetlabs/puppet/hiera.yaml: Use of 'hiera.yaml' version 3 is deprecated. It should be converted to version 5
         (in /etc/puppetlabs/puppet/hiera.yaml)
      Warning: /etc/puppetlabs/puppet/hiera.yaml: merge_option 'overwrite_arrays' is not recognized. Option is ignored
      Searching for "lookup_options"
        Global Data Provider (hiera configuration version 3)
          Using configuration "/etc/puppetlabs/puppet/hiera.yaml"
          Merge strategy hash
            Hierarchy entry "yaml"
              Merge strategy hash
                Path "/etc/puppetlabs/code/environments/v3_config_and_data_jmfzk9h3/hieradata/somesuch.yaml"
                  Original path: "somesuch"
                  No such key: "lookup_options"
                Path "/etc/puppetlabs/code/environments/v3_config_and_data_jmfzk9h3/hieradata/common.yaml"
                  Original path: "common"
                  Path not found
            Hierarchy entry "json"
              Merge strategy hash
                Path "/etc/puppetlabs/code/environments/v3_config_and_data_jmfzk9h3/hieradata/somesuch.json"
                  Original path: "somesuch"
                  No such key: "lookup_options"
                Path "/etc/puppetlabs/code/environments/v3_config_and_data_jmfzk9h3/hieradata/common.json"
                  Original path: "common"
                  Path not found
      Searching for "environment_key4"
        Global Data Provider (hiera configuration version 3)
          Using configuration "/etc/puppetlabs/puppet/hiera.yaml"
          Merge strategy deep
            Hierarchy entry "yaml"
              Merge strategy deep
                Path "/etc/puppetlabs/code/environments/v3_config_and_data_jmfzk9h3/hieradata/somesuch.yaml"
                  Original path: "somesuch"
                  Found key: "environment_key4" value: [
                    "val",
                    4
                  ]
                Path "/etc/puppetlabs/code/environments/v3_config_and_data_jmfzk9h3/hieradata/common.yaml"
                  Original path: "common"
                  Path not found
                Merged result: [
                  "val",
                  4
                ]
            Hierarchy entry "json"
              Merge strategy deep
                Path "/etc/puppetlabs/code/environments/v3_config_and_data_jmfzk9h3/hieradata/somesuch.json"
                  Original path: "somesuch"
                  Found key: "environment_key4" value: [
                    "jsonval",
                    "4"
                  ]
                Path "/etc/puppetlabs/code/environments/v3_config_and_data_jmfzk9h3/hieradata/common.json"
                  Original path: "common"
                  Path not found
                Merged result: [
                  "jsonval",
                  "4"
                ]
            Merged result: [
              "jsonval",
              "4",
              "val",
              4
            ]
      [root@tcqscrr9nhig5nu v3_config_and_data_jmfzk9h3]# puppet lookup --environment v3_config_and_data_jmfzk9h3 environment_key4
      Warning: /etc/puppetlabs/puppet/hiera.yaml: Use of 'hiera.yaml' version 3 is deprecated. It should be converted to version 5
         (in /etc/puppetlabs/puppet/hiera.yaml)
      Warning: /etc/puppetlabs/puppet/hiera.yaml: merge_option 'overwrite_arrays' is not recognized. Option is ignored
      ---
      - jsonval
      - '4'
      - val
      - 4
      

      also when using --explain the value doesn't pop out in the same format. maybe this is ok.
      i also find it somewhat strange that the value is presented in yaml, in particular because i'm not only using a yaml backend here.
      i kinda expect it in puppet pp format

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                erict Eric Thompson
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support