The codedir is the main directory for Puppet code and data, and is used by Puppet master, Puppet apply, but not by Puppet agent. It contains environments (which contain your manifests and modules), a global modules directory for all environments, and your Hiera data.
*nix non-root users:
When Puppet is running as root, a Windows user with administrator privileges, or the
puppet user, it uses a system-wide codedir. When running as a non-root user, it uses a codedir in that user's home directory.
When running Puppet commands and services as
puppet, usually you want to use the system codedir. To use the same codedir as the Puppet agent, or Puppet master, run admin commands such as
puppet module with
config.rufile must explicitly set
--codedirto the system codedir. The example
config.rufile provided with the Puppet source does this.
To configure the location of the codedir in
puppet.conf, use the the
puppet.conf, and instead uses the
puppetserver.conf. When using a non-default codedir, you must change both settings.
$codedirvariable in the value of any other setting in
[master] environmentpath = $codedir/override_environments:$codedir/environments
If you need to set nonstandard values for some settings, this allows you to avoid absolute paths and keep your Puppet-related files together.
The codedir contains environments, including manifests and modules, a global modules directory for all environments, and Hiera data.