To share the Bolt plans and tasks that you've created on the Forge, you can package them into Puppet modules. If you'd like to use a plan or task from a module that you found on the Forge, you can use Bolt to install the module.
🧪 New experimental module management
Experimental: Bolt 2.30.0 introduced changes to how modules are managed in Bolt projects. To find out how to opt in to the changes, see Managing modules.
Create a new Bolt project and install a list of modules with dependencies
If you want to get started with a new Bolt project and you need specific modules from the Puppet Forge, you can install the modules and their dependencies using the Bolt command line.
When you create a new project with the
modules command-line option and a
comma-separated list of Forge modules, Bolt installs the latest versions of each
module and resolves and installs all dependencies required by those modules. For
example, to create a project named
example_project with the
mysql modules installed, use the following command:
*nix shell command
bolt project init example_project --modules puppetlabs-apache,puppetlabs-mysql
New-BoltProject -Name example_project -Modules puppetlabs-apache,puppetlabs-mysql
The project's Puppetfile lists the
mysql modules and all of their
# example_project/Puppetfile mod 'puppetlabs-apache', '5.5.0' mod 'puppetlabs-mysql', '10.6.0' mod 'puppetlabs-stdlib', '6.3.0' mod 'puppetlabs-concat', '6.2.0' mod 'puppetlabs-translate', '2.2.0' mod 'puppetlabs-resource_api', '1.1.0' mod 'puppetlabs-puppetserver_gem', '1.1.1'
Install a module to an existing project
If you want to install a module to an existing project, use a Puppetfile. This method does not automatically resolve module dependencies. If the module you're installing requires other modules, make sure you add the required modules to your Puppetfile together with the module you're installing.
Before you begin
In your Bolt project directory, create a file named
Add any modules stored locally in
modules/to the list. For example,
mod 'my_awesome_module', local: true
Bolt deletes any content in
modules/that is not listed in your Puppetfile. If you want to keep the content, but you don't want to manage it with the Puppetfile, move the content to a
site-modulesdirectory in your project.
To install a module:
Open Puppetfile in a text editor and add the modules and versions that you want to install. If the modules have dependencies, list those as well. For example:
# Modules from the Puppet Forge. mod 'puppetlabs-apache', '4.1.0' mod 'puppetlabs-postgresql', '5.12.0' mod 'puppetlabs-puppet_conf', '0.3.0' # Modules from a Git repository. mod 'puppetlabs-haproxy', git: 'https://github.com/puppetlabs/puppetlabs-haproxy.git', ref: 'master'
bolt puppetfile installcommand. Bolt installs modules to the first directory in the
modulepathsetting. By default, this is the
modules/subdirectory inside the Bolt project directory. To override this location, update the
modulepathsetting in your project configuration file.
Bolt is packaged with a collection of useful modules to support common workflows.
🔩 Tip: To see a list of all modules on your current modulepath, use
bolt puppetfile show-modules.
Modules installed on your modulepath take precedence over packaged modules with
the same name. If you need to use a specific version of a packaged module, you
can override the packaged version by installing the module into your
directory. If you’ve altered the modulepath in your Bolt configuration, and you
want to override a packaged module, your altered modulepath must include the
directory where you’ve installed the module.
Note: If you installed Bolt as a Ruby Gem, make sure you have installed these core modules.
Modules with useful task and plan content
package: Install, uninstall, update, and check the status of packages.
service: Manage and inspect the state of services.
puppet_conf: Inspect and change the configuration options in the
facts: Retrieve facts from specified targets.
puppet_agent: Install Puppet Agent package.
reboot: Manage system reboots.
Core Puppet providers
augeas_core: Manage configuration files using Augeas.
host_core: Manage host entries in a hosts file.
scheduled_task: Provider capable of using the Version 2 Windows API for task management.
cron_core: Install and manage
mount_core: Manage mounted filesystems and mount tables.
selinux_core: Manage Security-Enhanced Linux.
yumrepo_core: Manage client yum repo configurations by parsing INI configuration files.
zone_core: Manage Solaris zone resources.
Bolt-specific modules that are not available on the Forge
Modules that contain helper code for writing your own tasks
ruby_task_helper: A helper for writing tasks in Ruby.
python_task_helper: A helper for writing tasks in Python.
📖 Related information
For modules that require Ruby Gems, see Install Gems with Bolt packages
For more details about specifying modules in a Puppetfile, see the Puppetfile documentation.
For more information on structuring your Bolt project directory, see Bolt project directories.
Search the Puppet Forge for plan and task content.
For an example of a Puppetfile, see the Bolt Puppetfile