When running Puppet in masterless mode, meaning there is no Puppet Master for the node to connect to, one of the problems you have to solve is how to get all your Puppet modules onto the node. Without going into all the possible ways of doing this, one nice and clean way to solve the problem is to use a Puppetfile.
If you know what a Ruby gemfile is, you can guess what a Puppetfile is. If you don't, think of a very simple list declaring the modules that a node should get, including ways to get those modules. Like this:
forge 'forge.puppetlabs.com'
mod 'maestrodev/wget'
mod 'painkeep',
:git => 'https://github.com/brasey/painkeep'
Here's an example showing off several ways to declare a module:
# Install puppetlabs/apache and keep it up to date with 'master'
mod 'apache',
:git => 'https://github.com/puppetlabs/puppetlabs-apache'
# Install puppetlabs/apache and track the 'docs_experiment' branch
mod 'apache',
:git => 'https://github.com/puppetlabs/puppetlabs-apache',
:ref => 'docs_experiment'
# Install puppetlabs/apache and pin to the '0.9.0' tag
mod 'apache',
:git => 'https://github.com/puppetlabs/puppetlabs-apache',
:tag => '0.9.0'
# Install puppetlabs/apache and pin to the '83401079' commit
mod 'apache',
:git => 'https://github.com/puppetlabs/puppetlabs-apache',
:commit => '83401079053dca11d61945bd9beef9ecf7576cbf'
# Install puppetlabs/apache and track the 'docs_experiment' branch
mod 'apache',
:git => 'https://github.com/puppetlabs/puppetlabs-apache',
:branch => 'docs_experiment'
I don't know how anyone does anything with Puppet without using r10k. If your Puppet modules are in version control (looking at you) and you use modules from the Puppet Forge, or any other place, r10k is the magic that ties it all together. It even makes your git branches magically turn into environments on a Puppet master, but that's a story for another day.
The Puppetfile should be in the same directory where your 'modules' directory lives. If for you that is /etc/puppet/modules, then your Puppetfile should be at /etc/puppet/Puppetfile.
cd /etc/puppet
sudo r10k puppetfile install
That will pull down whatever you have defined in your Puppetfile into /etc/puppet/modules. Now you just have to run Puppet:
sudo puppet apply --modulepath=/etc/puppet/modules /etc/puppet/manifests/site.pp
assuming you've defined your entrypoint at that site.pp location. You could point somewhere else if you need to.
I always like the idea of using Puppet Masterless in a more distributed mode. I believe we can also mix hiera into the picture for the
puppet apply
too.