Bolt runs in the context of a project directory or a
directory contains all of the configuration, code, and data loaded by
The project directory structure makes it easy to share Bolt code by committing the project directory to Git. You can then check different repositories of Bolt code into different directories in order to manage various applications.
Types of project directories
There are three types of project directories that you can use depending on how you're using Bolt.
Local project directory
Bolt treats a directory containing a
bolt.yaml file as a project directory. Use
this type of directory to track and share management code in a
bolt.yamlfile to it and configuring the
modulepathto match the
project/ ├── Puppetfile ├── bolt.yaml ├── data │ └── common.yaml ├── inventory.yaml └── site-modules └── project ├── manifests │ └── my_class.pp ├── plans │ ├── deploy.pp │ └── diagnose.pp └── tasks ├── init.json └── init.py
Embedded project directory
Bolt treats a directory containing a subdirectory called
Boltdir as a project
directory. Use this type of directory to embed
Bolt management code
into another repo.
For example, you can store management code in the same repo as the application it manages without cluttering up the top level with multiple files. This structure allows you to run Bolt from anywhere in the application's directory structure.
project/ ├── Boltdir │ ├── Puppetfile │ ├── bolt.yaml │ ├── data │ │ └── common.yaml │ ├── inventory.yaml │ └── site-modules │ └── project │ ├── manifests │ │ └── my_class.pp │ ├── plans │ │ ├── deploy.pp │ │ └── diagnose.pp │ └── tasks │ ├── init.json │ └── init.py ├── src #non Bolt source code for the project └── tests #non Bolt tests for the project
Boltdirdirectory is used as the project directory rather then the parent.
User project directory
If Bolt can't find a project directory based on
~/.puppetlabs/bolt as the project directory. Use this type of
directory if you have a single set of Bolt code and data that you use
across all projects.
How the project directory is chosen
Bolt uses these methods, in order, to choose a project directory.
You can specify on the command line what directory Bolt should use with
--boltdir <DIRECTORY_PATH>. There is not an equivalent configuration setting because the project directory must be known in order to load configuration.
Bolt traverses parents of the current directory until it finds a directory containing a
bolt.yaml, or it reaches the root of the file system.
User project directory
If no directory is specified manually or found in a parent directory, the user project directory is used.
Project directory structure
The default paths for all Bolt configuration, code, and data are relative to the modulepath.
||Contains configuration options for Bolt.|
Hiera config to use for node-specific data when using |
||Contains a list of known targets and target specific data.|
||Specifies which modules should be installed for the project.|
||The directory where modules from the |
||Local modules that are edited and versioned with the project directory.|
||The standard path to store static Hiera data files.|