Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d527771a1b

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

..
Octocat-spinner-32 whereareyou
Octocat-spinner-32 README.md
README.md

Find where a module is loaded from

This trick uses a template, $settings::modulepath, and FILE from a template to find the location of a template (and thus its module) relative to the puppet module path.

From this directory, run:

% puppet apply --modulepath . -e 'include whereareyou'

Output:

notice: Scope(Class[Whereareyou]): [".", "whereareyou/templates/example.erb"]

The output above is ["module path for this file", "file path relative to the modulepath"]

Another example run with multiple module paths:

% puppet apply --modulepath /tmp:../where-art-thou  -e 'include whereareyou'
notice: Scope(Class[Whereareyou]): ["../where-art-thou", "whereareyou/templates/example.erb"]
Something went wrong with that request. Please try again.