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

Add a module_directory function that returns a module's directory path

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.8.1
    • Fix Version/s: PUP 5.4.0
    • Component/s: Language
    • Labels:
      None
    • Template:
    • Sub-team:
    • Team:
      Platform Core
    • Sprint:
      Platform Core KANBAN
    • Release Notes:
      New Feature
    • Release Notes Summary:
      The function {{module_directory}} has been added - it finds a module by name and returns the file system path to its root directory, or {{undef}} if module is not found on the modulepath.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Add a function module_directory(names) that returns the path of the first found module on the module path, or undef if none of the given names is a module on the modulepath.

      ORIGINAL


      It would be very useful for calling generator scripts in the files directory of the current module if the path to the current module (in particular which of the entries in module_path is currently used) would be supplied as a compiler variable similar to module_name.

      Currently it is only possible to hard-code that component of the path as far as I can tell, e.g.

      ${settings::environmentpath}/${environment}/modules/module_name/files/gen_script.sh
      

      This works fine for most cases but we are currently using several folders in the environment.conf's module_path, one for local modules that abstract away stuff for specific hosts, one for shared modules between different customer's puppet masters and our own and now one for shared modules between our old and new environments (rewrite of our internal modules to support multiple Linux distributions and follow more best practices but not all hosts are migrated to it yet).

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                mhoermann Matthias Hörmann
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: