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

Add data_provider to module metadata

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 4.3.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Epic Link:
    • Story Points:
      2
    • Sprint:
      Language 2015-07-08, Language 2015-07-22, Language 2015-08-05, Language 2015-08-19
    • Release Notes:
      New Feature

      Description

      Currently, to setup data binding for a module this is required:

      # <moduleroot>/lib/puppet/bindings/mymodule/default.rb
      #
      Puppet::Bindings.newbindings('mymodule::default') do
        bind {
          name         'mymodule'            # name of the module this is placed in
          to           'function'            # name of the data provider
          in_multibind 'puppet::module_data' # boiler-plate
        }
      end
      

      none of this does anything for the user other than specify that this module provides data implicitly from its data() function.

      This should be replaced with a single entry in Metadata.json. The key data_provider is optional, and if used is a single string data provider symbolic name.

      See PUP-4454 for the corresponding entry in environment.conf.

      UPDATE


      Module meta-data can now optionally contain binding information for a 'data in modules' data provider.

      "data_provider":  "symbolic_name"
      

      where the key <symbolic_name> must be a string that matches /^[a-zA-Z][a-zA-Z0-9_]*$/

        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