Last change
on this file since 30960 was 30960, checked in by davidb, 7 years ago |
Switch to using Puppet to provision machine. Strongly based on files developed for spark-hdfs cluster
|
File size:
612 bytes
|
Line | |
---|
1 | module Puppet::Parser::Functions
|
---|
2 | newfunction(:get_module_path, :type =>:rvalue, :doc => <<-EOT
|
---|
3 | Returns the absolute path of the specified module for the current
|
---|
4 | environment.
|
---|
5 |
|
---|
6 | Example:
|
---|
7 | $module_path = get_module_path('stdlib')
|
---|
8 | EOT
|
---|
9 | ) do |args|
|
---|
10 | raise(Puppet::ParseError, "get_module_path(): Wrong number of arguments, expects one") unless args.size == 1
|
---|
11 | if module_path = Puppet::Module.find(args[0], compiler.environment.to_s)
|
---|
12 | module_path.path
|
---|
13 | else
|
---|
14 | raise(Puppet::ParseError, "Could not find module #{args[0]} in environment #{compiler.environment}")
|
---|
15 | end
|
---|
16 | end
|
---|
17 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.