So… this is a bit embarrassing, but…
Environments.
Right there in my /etc/puppet.conf
file is this:
[master]
manifest=$confdir/manifests/site.pp
modulepath=$confdir/environments/$environment/modules:$confdir/modules
After throwing strace
at it to figure out where it was hunting for files, I noticed something. It was looking for custommod under /etc/puppet/environments/production/modules
, and since there was a directory there (empty), it did not then go check /etc/puppet/modules
. Apparently when importing a module it checks for directory-presence, rather than file-presence (init.pp).
Remove that empty directory, things start working.
Run the puppet agent using a different environment, things start working.
Moral of the story:
Puppet Environment paths do not act like bash $PATH.