Answering my own question.
Do I always have to pre-install modules in order for me to use them?
No, I don't. In a single node set up (masterless) the modules can be put into the --modulepath=/my-module-root
path and puppet will pick them up. My problem was that the folder name for the module, did not match the class in the init.pp
. For example
| modules | -- gini_cassandra ++ HERE ++ | ---- manifests | ------ init.pp
Inside init.pp
I had
class cassandra ...
Once I renamed gini_cassandra
to cassandra
things started working.
How do I automate Puppet modules installation?
As I don't need to install
the modules in a masterless setup, I don't need to automate it. However, I found librarian-puppet
(thanks to this answer) to be really useful. I don't need to version-control external modules. Librarian will pull them for me on both my machine, target machine where I run installation, and on the build machine.