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

When a module using lookup_options include another using lookup_options the 2nd is ignored

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: PUP 4.3.1
    • Fix Version/s: PUP 4.3.2
    • Component/s: None
    • Labels:
      None
    • Template:
    • Story Points:
      1
    • Sprint:
      Language 2015-12-30, Language 2016-01-13
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      When a module using lookup_options includes another using lookup_options, the second is ignored. This fixes that.

      Description

      Given 2 modules both with lookup_options based hiera configuration is used like this:

      class profile::base(
        Array[String] $packages = []
      ) {
        notice($packages)
       
        include users
      }
      

      and the users module is:

      class users($local={}) {
        notice($local)
      }
      

      With both modules configured to use lookup_options to set the their parameters as merging keys the following happens:

      Including the users class directly works, data is merged as per the strategy:

      $ puppet apply -e 'include users' --test
      Notice: Scope(Class[Users]): {bob => {name => Bob, shell => /bin/zsh}}
      

      But if I include the profile - which has its own lookup_options - then the included class strategy is ignored and a first match lookup is done:

      $ puppet apply -e 'include profile::base' --test
      Notice: Scope(Class[Users]): {bob => {shell => /bin/zsh}}
      

      I think the description here is probably not enough but it's hard given the amount of files needed to reproduce so I am attaching a tarball with a reproducing setup, extract into ~/.puppetlabs/etc/ and fix the :datadir: path in ~/.puppetlabs/etc/code/hiera.yaml

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ripienaar R.I.Pienaar
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support