Say I have two locally extant modules that don't exist on Forge or in a custom Forge-like repo. These repos will never be installed via command line as they are part of a bigger deployment that cannot use the Forge-like installation commands - they are put there by hand or by repo cloning.
ModuleA
defines a function in its functions
folder, and is invokable in the scope of ModuleA
. All good.
ModuleB
tries to invoke the function from ModuleA
and fails as due to the module not being installed and findable for the JSON manifest.
Can this limitation be gotten around nicely? Classes can be invoked in this way - I don't want to sacrifice good design for this awkward limitation.
Figured this one out - if you wish to import functions for a module in the same space all you need to do is include the module in
dependencies
in themetadata.json
file for the module that is importing (ModuleB in my above question). The usage ofmanifest
in their documentation is confusing - including it in themetadata
would be more correct.So a dependency node in the
metadata.json
file would be something likewith the
moduleb
containing the importable functions. This probably means that you can't use the Puppet forge correctly, but if you are dealing with this problem you likely aren't losing much there.