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

Lookup data provider should allow dot in %{key.subkey} to be escaped

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: PUP 4.3.2
    • Fix Version/s: PUP 4.4.1
    • Component/s: None
    • Labels:
    • Environment:

      OS: Ubuntu Trusty
      package: puppet-agent 1.3.5

    • Template:
    • Epic Link:
    • Story Points:
      2
    • Sprint:
      Language 2016-03-23
    • Release Notes Summary:
      Hide
      Hiera data files to provide values at the environment and module levels can now provide values from variables with dots ('.') in their names, provided that name is properly quoted. E.g. this value from production/data/common.yaml:

        env_production_hardware_platform: "%{'hardware.platform'}"
      Show
      Hiera data files to provide values at the environment and module levels can now provide values from variables with dots ('.') in their names, provided that name is properly quoted. E.g. this value from production/data/common.yaml:   env_production_hardware_platform: "%{'hardware.platform'}"

      Description

      In hieradata, it's possible to interpolate a hash in a yaml file like this:

      foo: '%{key.subkey.subsubkey}'
      

      For instance:

      address: '%{::facts.networking.interfaces.eth0.bindings.0.address}'
      

      But it's currently impossible if a subkey contains a dot character. For instance, in the example above, if the interface is eth0.1000 (interface of the VLAN ID 1000) instead of eth0, the interpolation is impossible.

      It could be nice if a syntax like below worked (currently it doesn't) ie with double quotes to escape the subkey which contains a dot character:

      address: '%{::facts.networking.interfaces."eth0.1000".bindings.0.address}'
      

      In this case the syntax will be the same as the facter command ie:

      facter 'networking.interfaces."eth0.1000".bindings.0.address'
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                flaf Francois Lafont
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support