I just want to add my experience here.
So I had this module, let's call it test
for now with this directory structure :
/etc/puppet
|- modules
|- test
| |- manifests
| |- init.pp
| |- metadata.json
| |- README.md
| |- Modulefile
| |- LICENSE
Content of init.pp
is simply class test(){}
Trying to do a include test
always resulted in Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class
.
It turns out that my metadata.json
was the problem. Indeed, here is what the content I had
{
"name": "test",
"version": "1.0.0",
"author": "TEST",
"license": "Apache License, Version 2.0",
"summary": "TEST",
"source": "",
"project_page": "https://github.com/test/test"
}
Adding the dependencies
key solved my issue.
{
"name": "test",
"version": "1.0.0",
"author": "TEST",
"license": "Apache License, Version 2.0",
"summary": "TEST",
"source": "",
"project_page": "https://github.com/test/test"
"dependencies": [
]
}
Notice how the project page is missing a ,
at the end ? Well, this made it work anyways even if the metadata.json is not valid json.
My question is : what the hell is going on ?